Some UndoRedoAction types lack surface_index
Posted: Sun Feb 02, 2025 1:15 am
[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.
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.