Merge pull request #8325 from Mailaender/foundations-zero-tiles
Fixed a division through zero
This commit is contained in:
@@ -52,7 +52,10 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
safeTiles++;
|
||||
}
|
||||
|
||||
if (totalTiles > 0)
|
||||
damageThreshold = (info.DamageThreshold * health.MaxHP + (100 - info.DamageThreshold) * safeTiles * health.MaxHP / totalTiles) / 100;
|
||||
else
|
||||
damageThreshold = health.HP;
|
||||
|
||||
// Actors start with maximum damage applied
|
||||
var delta = health.HP - damageThreshold;
|
||||
|
||||
Reference in New Issue
Block a user