combat_robot.last_user is nil

This subforum contains all the issues which we already resolved.
User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 525
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

combat_robot.last_user is nil

Post 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..."
Rseding91
Factorio Staff
Factorio Staff
Posts: 16025
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: combat_robot.last_user is nil

Post 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
If you want to get ahold of me I'm almost always on Discord.
User avatar
Mylon
Filter Inserter
Filter Inserter
Posts: 525
Joined: Sun Oct 23, 2016 11:42 pm
Contact:

Re: combat_robot.last_user is nil

Post by Mylon »

To clarify, my use case is on_entity_died:

player = event.cause.last_user
give_credit(player)
Post Reply

Return to “Resolved Problems and Bugs”