Page 1 of 1

LuaEntity placed by

Posted: Sat Jun 25, 2016 5:57 am
by Simcra
I understand that LuaEntityPrototype contains items_to_place_this, sometimes this is incredibly useful and sometimes it is not. If each LuaEntity contained the player index (if placed by a player, or nil otherwise) as well as the item prototype used to place it, entities could be reverted to their exact item used for placement and inserted into the players inventory with much less work.

Re: LuaEntity placed by

Posted: Sat Jun 25, 2016 7:02 am
by Rseding91
If each LuaEntity contained the player index (if placed by a player, or nil otherwise) as well as the item prototype used to place it, entities could be reverted to their exact item used for placement and inserted into the players inventory with much less work
In 0.13 entities with a force contain the player_index that built them if any. The item that was used is irrelevant as the mineable properties determine what an entity mines to not what was used to build it.