mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-09 23:39:40 +07:00
Fixed broken tests due to 'impassible' changes
This commit is contained in:
@ -560,6 +560,7 @@ Load game =
|
||||
Main menu =
|
||||
Resume =
|
||||
Cannot resume game! =
|
||||
Not enough memory on phone to load game! =
|
||||
Quickstart =
|
||||
Victory status =
|
||||
Social policies =
|
||||
|
@ -155,7 +155,11 @@ class MainMenuScreen: CameraStageBaseScreen() {
|
||||
private fun autoLoadGame() {
|
||||
try {
|
||||
game.loadGame(autosave)
|
||||
} catch (ex: Exception) { // silent fail if we can't read the autosave
|
||||
}
|
||||
catch (outOfMemory:OutOfMemoryError){
|
||||
ResponsePopup("Not enough memory on phone to load game!", this)
|
||||
}
|
||||
catch (ex: Exception) { // silent fail if we can't read the autosave
|
||||
ResponsePopup("Cannot resume game!", this)
|
||||
}
|
||||
}
|
||||
|
@ -327,15 +327,17 @@ class UnitMovementAlgorithms(val unit:MapUnit) {
|
||||
// so multiple callees of this function have been optimized,
|
||||
// because optimization on this function results in massive benefits!
|
||||
fun canPassThrough(tile: TileInfo): Boolean {
|
||||
if (tile.isImpassible()) return false
|
||||
if (tile.isImpassible()){
|
||||
// special exception - ice tiles are technically impassible, but somme units can move through them anyway
|
||||
if (!(tile.terrainFeature == Constants.ice && unit.canEnterIceTiles))
|
||||
return false
|
||||
}
|
||||
if (tile.isLand
|
||||
&& unit.type.isWaterUnit()
|
||||
// Check that the tile is not a coastal city's center
|
||||
&& !(tile.isCityCenter() && tile.isCoastalTile()))
|
||||
return false
|
||||
|
||||
if (tile.terrainFeature == Constants.ice && !unit.canEnterIceTiles)
|
||||
return false
|
||||
|
||||
if (tile.isWater && unit.type.isLandUnit()) {
|
||||
if (!unit.civInfo.tech.unitsCanEmbark) return false
|
||||
|
@ -116,7 +116,7 @@ class UnitMovementAlgorithmsTests {
|
||||
@Test
|
||||
fun canNOTEnterNaturalWonder() {
|
||||
tile.baseTerrain = Constants.plains
|
||||
tile.naturalWonder = "Wonder Thunder"
|
||||
tile.naturalWonder = "Mount Fuji"
|
||||
tile.setTransients()
|
||||
|
||||
for (type in UnitType.values()) {
|
||||
|
Reference in New Issue
Block a user