Page 1 of 1

[Rseding91] Insta-undo in the map editor raises no events

Posted: Sat Jun 11, 2022 9:57 pm
by raiguard
When using the map editor's instant undo feature, no events are fired for the destruction of the entities. This breaks several of my mods.

Insta-deconstruction with the deconstruction planner raises script_raised_destroy, so that might make sense, but as long as it fires something, I'll be happy.

Steps to reproduce:
1. Write callbacks for every kind of entity destroyed event (excluding on_entity_destroyed)
2. Place something using the map editor
3. Undo that placement
4. Observe that no events are raised.

I could register them for on_entity_destroyed, but that feature is not meant to be used at scale, and I would have to add it to every single rolling stock on the map.

Re: Insta-undo in the map editor raises no events

Posted: Sun Jun 12, 2022 1:08 pm
by Rseding91
Raiguard wrote:
Sat Jun 11, 2022 9:57 pm
I could register them for on_entity_destroyed, but that feature is not meant to be used at scale, and I would have to add it to every single rolling stock on the map.
Just for reference: on_entity_destroyed *is* meant to be used at scale. It has constant-time O(1) for every operation around it :)

Re: [Rseding91] Insta-undo in the map editor raises no events

Posted: Tue Jun 14, 2022 5:13 pm
by Rseding91
Thanks for the report however I can't reproduce what you describe. It raises script_raised_destroy every time.