A user of my mod encountered a bug where the player.undo_redo_stack.get_undo_item(1) returned an array where the first index is empty but starting from index 2 it's filled as expected.
In this screenshot you can see the undo_items array starting at index 2.
I don't completely understand the situation but I have a repro and after discussing it on the Discord with Protocol_1903 and Jarg, Protocol asked me to report this as a bug.
You can read our discussion here.
I have attached a save file for the repro.
You need version 1.13.3 of the mod Canal Excavator (I fixed it in 1.13.4) then:
1. Open the save file.
2. Grab the blueprint that should be in the first quickbar slot.
3. Drag it from the existing left most Canal Excavator to the left
It should crash immediately when the blueprint snaps to the left with "attempt to index local 'undo_item' (a nil value)" like in the screenshot above.
[2.0.76] player.undo_redo_stack.get_undo_item first index empty
[2.0.76] player.undo_redo_stack.get_undo_item first index empty
- Attachments
-
- stack-hole-bug.zip
- (19.18 MiB) Downloaded 7 times

