mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 03:24:06 +09:00
save/load kinda mostly working but fixtures are not getting their sprites back
This commit is contained in:
@@ -133,10 +133,7 @@ class GameWorld() : Disposable {
|
||||
lastPlayTime = lastPlayTIME_T
|
||||
this.totalPlayTime = totalPlayTime
|
||||
|
||||
postLoad()
|
||||
}
|
||||
|
||||
fun postLoad() {
|
||||
AppLoader.tileMaker.tags.forEach {
|
||||
printdbg(this, "tileNumber ${it.value.tileNumber} <-> tileName ${it.key}")
|
||||
|
||||
@@ -148,6 +145,8 @@ class GameWorld() : Disposable {
|
||||
tileNumberToNameMap[0] = Block.AIR
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Load existing world
|
||||
*/
|
||||
@@ -271,7 +270,7 @@ class GameWorld() : Disposable {
|
||||
*/
|
||||
fun setTileTerrain(x: Int, y: Int, itemID: ItemID, bypassEvent: Boolean) {
|
||||
val (x, y) = coerceXY(x, y)
|
||||
val tilenum = tileNameToNumberMap[itemID]!!
|
||||
val tilenum = tileNameToNumberMap[itemID] ?: throw NullPointerException("Unknown tile name $itemID")
|
||||
|
||||
val oldTerrain = getTileFromTerrain(x, y)
|
||||
layerTerrain.unsafeSetTile(x, y, tilenum)
|
||||
|
||||
Reference in New Issue
Block a user