Some UndoRedoAction types lack surface_index

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
hgschmie
Fast Inserter
Fast Inserter
Posts: 117
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.
protocol_1903
Filter Inserter
Filter Inserter
Posts: 275
Joined: Fri Sep 09, 2022 4:33 pm
Contact:

Re: Some UndoRedoAction types lack surface_index

Post by protocol_1903 »

+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.
Post Reply

Return to “Modding interface requests”