fix: imported avatars trigger NPE on UILoadManage

This commit is contained in:
minjaesong
2023-10-06 15:05:47 +09:00
parent 781f671859
commit 0e21f28609
3 changed files with 3 additions and 2 deletions

View File

@@ -941,8 +941,8 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
uiContainer.forEach {
when (it) {
is UICanvas -> it.update(Gdx.graphics.deltaTime)
is Id_UICanvasNullable -> it.get()?.update(Gdx.graphics.deltaTime)
is UICanvas -> it.update(Gdx.graphics.deltaTime)
}
}
//uiFixture?.update(Gdx.graphics.deltaTime)

View File

@@ -19,6 +19,7 @@ class ItemLogicSignalEmitter(originalID: ItemID) : FixtureItemBase(originalID, "
override var baseToolSize: Double? = baseMass
override var originalName = "ITEM_LOGIC_SIGNAL_EMITTER"
override var inventoryCategory = Category.MISC
override fun effectWhileEquipped(actor: ActorWithBody, delta: Float) {
super.effectWhileEquipped(actor, delta)

View File

@@ -271,7 +271,7 @@ class UILoadManage(val full: UILoadSavegame) : UICanvas() {
it.mapIndexed { index, s -> "${(index+1).toString().padStart(it.size.fastLen())}. $s" }
} ?: listOf("$EMDASH")
loadOrderWorld =
App.savegameWorlds[full.playerButtonSelected!!.worldUUID]!!.files[selectedRevision].getFile(
App.savegameWorlds[full.playerButtonSelected!!.worldUUID]?.files?.get(selectedRevision)?.getFile( // it's null for freshly-imported avatars
VDFileID.LOADORDER
)?.getContent()?.toByteArray()?.toString(Common.CHARSET)?.split('\n')?.let {
it.mapIndexed { index, s -> "${(index+1).toString().padStart(it.size.fastLen())}. $s" }