Fixed a few bugs noted in #4057 (#4062)

This commit is contained in:
Xander Lenstra 2021-06-06 08:15:22 +02:00 committed by GitHub
parent 6c203d68f7
commit d7b2436bcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -1156,12 +1156,12 @@
"name": "Paratrooper",
"unitType": "Melee",
"movement": 2,
"strength": 40,
"strength": 65,
"cost": 375,
"requiredTech": "Radar",
"uniques": ["May Paradrop up to [5] tiles from inside friendly territory"],
"attackSound": "shot"
// 65 strength in expansions, upgradesTo "XCOM Squad", "No Movement Cost to Pillage" in BNW
// upgradesTo "XCOM Squad", "No Movement Cost to Pillage" in BNW
},
{
"name": "Infantry",

View File

@ -249,14 +249,15 @@ class UnitMovementAlgorithms(val unit:MapUnit) {
unit.putInTile(destination)
unit.currentMovement = 0f
return
} else if (unit.action == Constants.unitActionParadrop) { // paratrooping move differently
} else if (unit.action == Constants.unitActionParadrop) { // paratroopers move differently
unit.action = null
unit.removeFromTile()
unit.putInTile(destination)
unit.currentMovement -= 1f
unit.attacksThisTurn += 1
// Check if unit maintenance changed
// Is also done for other units, but because we skip everything else, we have to manually check it
// The reasong we skip everything, is that otherwise `getPathToTile()` throws an exception
// The reason we skip everything, is that otherwise `getPathToTile()` throws an exception
// As we can not reach our destination in a single turn
if (unit.canGarrison()
&& (unit.getTile().isCityCenter() || destination.isCityCenter())