[2.0.72] on_undo_applied is not fired for wire connections under certain circumstances

Post your bugs and problems so we can fix them.
Natha
Filter Inserter
Filter Inserter
Posts: 289
Joined: Sun Mar 15, 2015 1:48 pm
Contact:

[2.0.72] on_undo_applied is not fired for wire connections under certain circumstances

Post by Natha »

Steps to reproduce:
Use the mod I attached. Place 2 electric poles and connect them with red or green wire. Then press Ctrl+Z. The floating text states that the connection was undone, but no chat message.

When I disconnect a wire connection by script the next tick after it was connected and I want to undo it (not 'really' undo it, since the connection is already gone, but I want to catch the event for further scripting), the on_undo_applied event is not fired. However, the action is still in the undo stack and the floating text appears.

The mod prints a chat message when the event was fired.

Is this maybe because the game checks "oh, nothing to undo here" and therefore not firing the event? Because the action is also not on the redo stack after that.
Using a custom input assigned to ctrl+z and ctrl+y is not a solution, as clicking the shortcut buttons does not fire anything then.
Attachments
test_0.0.1.zip
(1.34 KiB) Downloaded 13 times
Post Reply

Return to “Bug Reports”