error trap to inform players wtf went wrong

This commit is contained in:
minjaesong
2021-09-18 10:57:22 +09:00
parent e22518530d
commit 2f19d2cd51
3 changed files with 131 additions and 54 deletions

View File

@@ -213,7 +213,7 @@ open class GameWorld() : Disposable {
return tileNumberToNameMap[layerWall.unsafeGetTile(x, y).toLong()]!!
}
catch (e: NullPointerException) {
val msg = "No tile name mapping for wall ${layerWall.unsafeGetTile(x, y)} in ($x, $y)"
val msg = "No tile name mapping for wall ${layerWall.unsafeGetTile(x, y)} in ($x, $y) from $layerWall"
throw NoSuchElementException(msg)
}
}
@@ -228,7 +228,7 @@ open class GameWorld() : Disposable {
return tileNumberToNameMap[layerTerrain.unsafeGetTile(x, y).toLong()]!!
}
catch (e: NullPointerException) {
val msg = "No tile name mapping for terrain ${layerTerrain.unsafeGetTile(x, y)} in ($x, $y)"
val msg = "No tile name mapping for terrain ${layerTerrain.unsafeGetTile(x, y)} in ($x, $y) from $layerTerrain"
throw NoSuchElementException(msg)
}
}