[boskid] [2.0.19] Crash with order_deconstruction (possible index out of bounds)
Posted: Sat Nov 16, 2024 3:00 pm
Steps to reproduce:
1. Load the attached mod file and then load the attached game.
2. Mark one or both of the "Linked Fast underground belt" in the middle of the screen for deconstruction (make sure instant deconstruct is off) (if alt-mode is on they should be linked by a white line)
What happens:
Bots come to deconstruct the Linked Fast underground belts (expected), and when they arrive the game crashes (unexpected).
Does it always happen?
With the steps above, it happend every time I tried it; 4/4 times.
I think this is because of on line 103 of the control.lua of the mod, as if you remove the third argument the steps above do not cause a crash. Also, when trying to replicate the crash in a new wave I got an index-out-of-bounds error instead of a crash.
I also attached the log and dump files.
I thought an index of 1 would be allowed, as the docs say "An index of 1 adds the action to the latest undo action on the stack."
1. Load the attached mod file and then load the attached game.
2. Mark one or both of the "Linked Fast underground belt" in the middle of the screen for deconstruction (make sure instant deconstruct is off) (if alt-mode is on they should be linked by a white line)
What happens:
Bots come to deconstruct the Linked Fast underground belts (expected), and when they arrive the game crashes (unexpected).
Does it always happen?
With the steps above, it happend every time I tried it; 4/4 times.
I think this is because of
Code: Select all
lbn.order_deconstruction(lbn.force, event.player_index, 1)
I also attached the log and dump files.
I thought an index of 1 would be allowed, as the docs say "An index of 1 adds the action to the latest undo action on the stack."