Fix bug in stat reducing not functioning properly
All checks were successful
Build / Build (push) Successful in 1m54s

This commit is contained in:
2026-07-01 17:56:13 +02:00
parent 14a6c9b4fb
commit 8fbf22a987
2 changed files with 106 additions and 1 deletions

View File

@@ -312,7 +312,7 @@ public abstract record ClampedStatisticSet<T> : StatisticSet<T> where T : struct
var current = GetStatistic(stat);
var newValue = Subtract(current, value);
if (newValue.CompareTo(Min) < 0)
value = Add(Min, current);
value = Subtract(current, Min);
if (value.CompareTo(default) == 0)
return false;
return base.DecreaseStatistic(stat, value);