Fixed bug where denmark's pillaging unique doesn't work (#5500)

This commit is contained in:
Xander Lenstra 2021-10-17 07:39:44 +02:00 committed by GitHub
parent ac422d25cb
commit 5c80e8ee9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -282,8 +282,9 @@ object UnitActions {
tile.improvement = null
if (tile.resource != null) tile.getOwner()?.updateDetailedCivResources() // this might take away a resource
val freePillage = unit.hasUnique("No movement cost to pillage") || unit.civInfo.hasUnique("No movement cost to pillage")
(unit.baseUnit.isMelee() && unit.civInfo.hasUnique("Melee units pay no movement cost to pillage"))
val freePillage = unit.hasUnique("No movement cost to pillage")
|| unit.civInfo.hasUnique("No movement cost to pillage")
|| (unit.baseUnit.isMelee() && unit.civInfo.hasUnique("Melee units pay no movement cost to pillage"))
if (!freePillage) unit.useMovementPoints(1f)
unit.healBy(25)