Page 1 of 1

on_precanceled_deconstruction

Posted: Sun Feb 19, 2017 10:57 am
by darkfrei
Hi!
on_canceled_deconstruction

Called when the deconstruction of an entity is canceled.

Contains
entity :: LuaEntity
player_index :: uint (optional)
The problem: Here player_index and entity.last_user.index is always same!

It comes while deconstructing planner rewrite all this info before it was read. There is no option to compare who was last_user of entities array and who has marked it to deconstruction.


Solution: on_precanceled_deconstruction, that can read all info before it will be overwritten.


Now I make some mod, that write some statistic to the file: Who has built entities, who has destroyed own buildings, who has destroyed not his buildings and who has marked all factory to deconstruction. Own built entities must be not included.