mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-04 23:40:01 +07:00
Fix division by zero crash (#8495)
This commit is contained in:

committed by
GitHub

parent
4ea644aa8d
commit
ee2bd20abe
@ -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 -
|
||||
|
Reference in New Issue
Block a user