Revert "perf: minor speedup in distance to tiles"

This reverts commit f78fbfd22d.
This commit is contained in:
yairm210 2024-09-16 04:13:33 +03:00
parent f78fbfd22d
commit 14115cdea7

View File

@ -69,8 +69,7 @@ class UnitMovement(val unit: MapUnit) {
}
}
val currentBestPath = distanceToTiles[neighbor]
if (currentBestPath == null || currentBestPath.totalDistance > totalDistanceToTile) { // this is the new best path
if (!distanceToTiles.containsKey(neighbor) || distanceToTiles[neighbor]!!.totalDistance > totalDistanceToTile) { // this is the new best path
val usableMovement = if (includeOtherEscortUnit && unit.isEscorting())
minOf(unitMovement, unit.getOtherEscortUnit()!!.currentMovement)
else unitMovement