mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 04:24:05 +09:00
quick and dirty solution deployed for the load screen dereferencing the dead pointer
This commit is contained in:
@@ -208,14 +208,7 @@ open class GameWorld() : Disposable {
|
||||
*/
|
||||
fun getTileFromWall(rawX: Int, rawY: Int): ItemID {
|
||||
val (x, y) = coerceXY(rawX, rawY)
|
||||
|
||||
try {
|
||||
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) from $layerWall"
|
||||
throw NoSuchElementException(msg)
|
||||
}
|
||||
return tileNumberToNameMap[layerWall.unsafeGetTile(x, y).toLong()] ?: throw NoSuchElementException("No tile name mapping for wall ${layerWall.unsafeGetTile(x, y)} in ($x, $y) from $layerWall")
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -223,14 +216,7 @@ open class GameWorld() : Disposable {
|
||||
*/
|
||||
fun getTileFromTerrain(rawX: Int, rawY: Int): ItemID {
|
||||
val (x, y) = coerceXY(rawX, rawY)
|
||||
|
||||
try {
|
||||
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) from $layerTerrain"
|
||||
throw NoSuchElementException(msg)
|
||||
}
|
||||
return tileNumberToNameMap[layerTerrain.unsafeGetTile(x, y).toLong()] ?: throw NoSuchElementException("No tile name mapping for terrain ${layerTerrain.unsafeGetTile(x, y)} in ($x, $y) from $layerTerrain")
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user