on_precanceled_deconstruction

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

on_precanceled_deconstruction

Post 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.
Post Reply

Return to “Modding interface requests”