[Rseding91] [0.14.13] Possible deconstruction bug
Posted: Fri Oct 07, 2016 6:52 pm
This behavior is extremely peculiar and it took me ages to figure out a way to reliably reproduce it.
When a mod invokes "order_deconstruction" on a belt entity in front of a mining drill output, that belt may not be deconstructed (despite being marked with a red cross in the game). This may happen when a mod caches the belt entities in eg. "on_init" and then tries to deconstruct the entities in "on_tick".
I've attached a simple mod and a savegame that displays this peculiar behavior.
Running the following command before the mod manage to mark the belts in front of the mining drills for deconstruction will cause all belts to be removed:
Letting the mod mark all belts for deconstruction and then (optionally) run the same command will likely result in some belts being left as shown on the image below:
I tried to load the savegame disabling all other mods except the attached mod just to rule out interference from other mods, but this resulted in Factorio crashing. I've attached the log file from this crash.
By additionally including mod "Creative Mode" I was able to load the savegame, and with only these two mods I was still able to reproduce the error.
When a mod invokes "order_deconstruction" on a belt entity in front of a mining drill output, that belt may not be deconstructed (despite being marked with a red cross in the game). This may happen when a mod caches the belt entities in eg. "on_init" and then tries to deconstruct the entities in "on_tick".
I've attached a simple mod and a savegame that displays this peculiar behavior.
Running the following command before the mod manage to mark the belts in front of the mining drills for deconstruction will cause all belts to be removed:
Code: Select all
/c for _, entity in pairs(game.surfaces[1].find_entities_filtered{name="transport-belt", force="player"}) do entity.order_deconstruction(entity.force) end
By additionally including mod "Creative Mode" I was able to load the savegame, and with only these two mods I was still able to reproduce the error.