Merge pull request #11653 from Mailaender/damagedbyterrain-div0

Fixed a division through zero in DamagedByTerrain.
This commit is contained in:
abcdefg30
2016-07-16 11:03:38 +02:00
committed by GitHub

View File

@@ -62,6 +62,9 @@ namespace OpenRA.Mods.Common.Traits
safeTiles++;
}
if (totalTiles == 0)
return;
damageThreshold = (Info.DamageThreshold * health.MaxHP + (100 - Info.DamageThreshold) * safeTiles * health.MaxHP / totalTiles) / 100;
// Actors start with maximum damage applied