player is now nullable; wtf is calling Ingame 5 times?

This commit is contained in:
minjaesong
2018-09-17 01:46:50 +09:00
parent ef8285dd97
commit 6a1146f67b
35 changed files with 252 additions and 150 deletions

View File

@@ -14,7 +14,11 @@ internal object SetScale : ConsoleCommand {
override fun execute(args: Array<String>) {
if (args.size == 2 || args.size == 3) {
try {
val targetID = if (args.size == 3) args[1].toInt() else (Terrarum.ingame!! as Ingame).playableActor.referenceID
val player = (Terrarum.ingame!! as Ingame).actorNowPlaying
if (player == null) return
val targetID = if (args.size == 3) args[1].toInt() else player.referenceID
val scale = args[if (args.size == 3) 2 else 1].toDouble()
val target = Terrarum.ingame!!.getActorByID(targetID!!)