mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-05 21:11:35 +07:00
Solve self-introduced bug in unit movement. Thank G-d (literaly) for ConsoleLauncher, may his name (G-d's) be blessed
This commit is contained in:
parent
c3d579b278
commit
0e612ac574
@ -44,7 +44,8 @@ class UnitMovement(val unit: MapUnit) {
|
||||
// If I can't move my only option is to stay...
|
||||
if (unitMovement == 0f || unit.cache.cannotMove) return distanceToTiles
|
||||
// If our escort can't move, ditto
|
||||
if (includeOtherEscortUnit && unit.getOtherEscortUnit()?.currentMovement == 0f) return distanceToTiles
|
||||
if (includeOtherEscortUnit && unit.isEscorting()
|
||||
&& unit.getOtherEscortUnit()?.currentMovement == 0f) return distanceToTiles
|
||||
|
||||
var tilesToCheck = listOf(unitTile)
|
||||
|
||||
@ -703,10 +704,10 @@ class UnitMovement(val unit: MapUnit) {
|
||||
movementCostCache: HashMap<Pair<Tile, Tile>, Float> = HashMap(),
|
||||
includeOtherEscortUnit: Boolean = true
|
||||
): PathsToTilesWithinTurn {
|
||||
val cacheResults = pathfindingCache.getDistanceToTiles(considerZoneOfControl)
|
||||
if (cacheResults != null) {
|
||||
return cacheResults
|
||||
}
|
||||
// val cacheResults = pathfindingCache.getDistanceToTiles(considerZoneOfControl)
|
||||
// if (cacheResults != null) {
|
||||
// return cacheResults
|
||||
// }
|
||||
val distanceToTiles = getDistanceToTilesAtPosition(
|
||||
unit.currentTile.position,
|
||||
unit.currentMovement,
|
||||
|
Loading…
Reference in New Issue
Block a user