setting up the inventory using builder (during init) requires ingame.player to be nullable, lateinit won't work

This commit is contained in:
Song Minjae
2017-04-11 23:07:29 +09:00
parent 1301121aa9
commit 037e84d6e2
21 changed files with 132 additions and 103 deletions

View File

@@ -34,11 +34,11 @@ class UIPieMenu : UICanvas {
var selection: Int = -1
override fun update(gc: GameContainer, delta: Int) {
if (selection >= 0)
Terrarum.ingame!!.player.actorValue[AVKey.__PLAYER_QUICKSLOTSEL] =
selection % slotCount
if (Terrarum.ingame!!.player != null) {
if (selection >= 0)
Terrarum.ingame!!.player!!.actorValue[AVKey.__PLAYER_QUICKSLOTSEL] =
selection % slotCount
}
}
override fun render(gc: GameContainer, g: Graphics) {