mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-15 19:42:10 +00:00
Fix profiler assertion failures
oops
This commit is contained in:
parent
b7887a339d
commit
3bd5169aee
2 changed files with 8 additions and 2 deletions
|
@ -90,6 +90,12 @@ private:
|
|||
float value = 0;
|
||||
int avgcount = 0;
|
||||
|
||||
inline void reset() {
|
||||
value = 0;
|
||||
// negative values are used for type checking, so leave them alone
|
||||
if (avgcount >= 1)
|
||||
avgcount = 0;
|
||||
}
|
||||
inline float getValue() const {
|
||||
return avgcount >= 1 ? (value / avgcount) : value;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue