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

@@ -24,7 +24,7 @@ internal object Teleport : ConsoleCommand {
return
}
Terrarum.ingame!!.player.setPosition(x.toDouble(), y.toDouble())
Terrarum.ingame!!.player!!.setPosition(x.toDouble(), y.toDouble())
}
else if (args.size == 4) {
if (args[2].toLowerCase() != "to") {
@@ -36,7 +36,7 @@ internal object Teleport : ConsoleCommand {
try {
val fromActorID = args[1].toInt()
val targetActorID = if (args[3].toLowerCase() == "player")
Terrarum.ingame!!.player.referenceID
Terrarum.ingame!!.player!!.referenceID
else
args[3].toInt()