1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-19 19:25:18 +02:00

Fix profiler assertion failures

oops
This commit is contained in:
sfan5
2024-04-20 14:32:35 +02:00
parent b7887a339d
commit 3bd5169aee
2 changed files with 8 additions and 2 deletions

View File

@@ -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;
}