[2.0.76] player.undo_redo_stack.get_undo_item first index empty

Things that has been reported already before.
jurgy
Inserter
Inserter
Posts: 38
Joined: Wed Feb 27, 2019 5:55 pm
Contact:

[2.0.76] player.undo_redo_stack.get_undo_item first index empty

Post by jurgy »

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.
05-19-2026, 22-19-23.png
05-19-2026, 22-19-23.png (47.77 KiB) Viewed 111 times
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.
Attachments
stack-hole-bug.zip
(19.18 MiB) Downloaded 6 times
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4555
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [2.0.76] player.undo_redo_stack.get_undo_item first index empty

Post by boskid »

Duplicate 131986
Post Reply

Return to “Duplicates”