Some UndoRedoAction types lack surface_index

User avatar
hgschmie
Fast Inserter
Fast Inserter
Posts: 155
Joined: Tue Feb 06, 2024 5:18 am
Contact:

Some UndoRedoAction types lack surface_index

Post by hgschmie »

[Not sure if this is a modding request or a bug report]

There are ten different UndoRedoAction types. Only three (removed-entity, built-tile and removed-tile) pass in the surface_index.

Trying to implement undo/redo for custom entities that retain state brings me to "keep a set of tombstones for entities that get deconstructed". All of the events operate on BlueprintEntity objects which contain position and direction, but not the surface. So trying to match up entities with my tombstones gets really hard as I do not know what surface to look at.

I can not use game.players[e.player_index].surface as the player could be on a different surface.

Please add the surface_index attribute to all the UndoRedoActions.
User avatar
protocol_1903
Filter Inserter
Filter Inserter
Posts: 413
Joined: Fri Sep 09, 2022 4:33 pm
Contact:

Re: Some UndoRedoAction types lack surface_index

Post by protocol_1903 »

+1 for consistency
Py and PyBlock developer, wielder of LUA in arbitrary ways. I make mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
Bilka
Factorio Staff
Factorio Staff
Posts: 3676
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Some UndoRedoAction types lack surface_index

Post by Bilka »

Okay, added surface_index to all remaining UndoRedoActions for 2.0.67. For wire removed and wire added it's part of the BlueprintWireEnds.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Post Reply

Return to “Implemented mod requests”