Safeguard from divide by 0 on replenish stat computation

This commit is contained in:
adpist
2025-10-12 13:01:07 +02:00
committed by guiyomu-dev
parent 8c72ab6d50
commit 3d5be6b2c0

View File

@@ -246,7 +246,9 @@ func (gd *GameReader) getStatsList(statListPtr uintptr) stat.Stats {
stat.ManaPerLevel:
value = int(math.Max(float64(statValue/2048), 1))
case stat.ReplenishDurability, stat.ReplenishQuantity:
value = int(math.Max(float64(2/statValue), 1))
if statValue > 0 {
value = int(math.Max(float64(2/statValue), 1))
}
case stat.RegenStaminaPerLevel:
value = int(statValue) * 10