[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.
Some UndoRedoAction types lack surface_index
-
- Filter Inserter
- Posts: 275
- Joined: Fri Sep 09, 2022 4:33 pm
- Contact:
Re: Some UndoRedoAction types lack surface_index
+1 for consistency
If you need to reach me, message me on discord.
I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.
I make qol mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
If you have a mod idea, I can look into it.