fixed an oversight where newly-added blocks would not be recognised by the old savegame

This commit is contained in:
minjaesong
2021-10-06 17:16:09 +09:00
parent 170503ecdb
commit c211b94b13
3 changed files with 18 additions and 25 deletions

View File

@@ -81,9 +81,12 @@ class ChunkLoadingLoadScreen(screenToBeLoaded: IngameInstance, private val world
val wx = (world.width.toFloat() / previewWidth * x).roundToInt()
val wy = (world.height.toFloat() / previewHeight * y).roundToInt()
val outCol = if (BlockCodex[world.getTileFromTerrain(wx, wy)].isSolid) WorldgenLoadScreen.COL_TERR
else if (BlockCodex[world.getTileFromWall(wx, wy)].isSolid) WorldgenLoadScreen.COL_WALLED
else WorldgenLoadScreen.COL_AIR
val outCol = try {
if (BlockCodex[world.getTileFromTerrain(wx, wy)].isSolid) WorldgenLoadScreen.COL_TERR
else if (BlockCodex[world.getTileFromWall(wx, wy)].isSolid) WorldgenLoadScreen.COL_WALLED
else WorldgenLoadScreen.COL_AIR
}
catch (e: NoSuchElementException) { WorldgenLoadScreen.COL_AIR }
previewPixmap.setColor(outCol)
previewPixmap.drawPixel(x, previewHeight - 1 - y) // this flips Y