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

Bugs that we were not able to reproduce, and/or are waiting for more detailed info.
Post Reply
User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 451
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

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

Post 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.
Don't forget, you're here forever.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13202
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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 :)
If you want to get ahold of me I'm almost always on Discord.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13202
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post by Rseding91 »

Thanks for the report however I can't reproduce what you describe. It raises script_raised_destroy every time.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Pending”