Fixed intercept chance being invertes (#5259)

Edit made on mobile and as such untested
This commit is contained in:
Xander Lenstra 2021-09-18 22:42:10 +02:00 committed by GitHub
parent ec0801ccef
commit ba679191f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -717,7 +717,7 @@ object Battle {
if (attacker.unit.hasUnique("Cannot be intercepted")) return
for (interceptor in interceptingCiv.getCivUnits()
.filter { it.canIntercept(attackedTile) }) {
if (Random().nextFloat() > 100f / interceptor.interceptChance()) continue
if (Random().nextFloat() > interceptor.interceptChance() / 100f) continue
var damage = BattleDamage.calculateDamageToDefender(
MapUnitCombatant(interceptor),
@ -828,4 +828,4 @@ object Battle {
return true
}
}
}