Page 1 of 1

combat_robot.last_user is nil

Posted: Mon May 29, 2017 4:28 pm
by Mylon
Combat robots do not report who created them.

To reproduce:
Throw a combat robot.
Mouse over it
Use command:

Code: Select all

/c game.print(game.player.selected.last_user)
Observed: Game prints "nil"

Expected: Game prints, "LuaPlayer does not contain key x..."

Re: combat_robot.last_user is nil

Posted: Mon May 29, 2017 5:02 pm
by Rseding91
Ok, I made it set the value on deploy but how would that be useful to have? The person they're floating around is the person who deployed them :P

Re: combat_robot.last_user is nil

Posted: Mon May 29, 2017 5:14 pm
by Mylon
To clarify, my use case is on_entity_died:

player = event.cause.last_user
give_credit(player)