Fix division by zero crash (#8495)

This commit is contained in:
OptimizedForDensity
2023-01-30 00:43:38 -05:00
committed by GitHub
parent 4ea644aa8d
commit ee2bd20abe

View File

@ -526,7 +526,7 @@ object UnitAutomation {
.sum() // City heals 20 per turn
if (expectedDamagePerTurn < city.health && // If we can take immediately, go for it
(expectedDamagePerTurn < 20 || city.health / (expectedDamagePerTurn-20) > 5)){ // otherwise check if we can take within a couple of turns
(expectedDamagePerTurn <= 20 || city.health / (expectedDamagePerTurn-20) > 5)){ // otherwise check if we can take within a couple of turns
// We won't be able to take this even with 5 turns of continuous damage!
// don't head straight to the city, try to head to landing grounds -