Closed Nexela closed 8 years ago
There shouldn't as such be a problem with instant deconstruction mods, if the mod only deconstructs entities that the player can place. The signals are decorative, do not have a selection box, and cannot be picked up or directly placed by the player. The normal Deconstruction Planner does not interact with decorative entities, so why should an instant one do so? I'll include the line 125 change, since it might make Bottleneck play better with misbehaving mods.
As for the "change_signal" function, there is no reason to check "entity and entity.valid", since the function can only be reached if entity is already valid (assuming items cannot be built invalid).
Wasn't sure on the entity part I just did a quick peek at your code. I was error-ing on 125 and the line with signal.name I didn't take into consideration that my version of the deconstruction planner is pretty aggressive it removes -all- entities and/or tiles. But thinking about it now it might be better if I add a few tick delay before looping through decoration entities after going through player place able entities..
Fixed in 0.3.2
Instant deconstruction mods can play havoc with bottleneck causing the entities and attached signals to become invalid.
Proposed changes:
control.lua line 125
if signal and signal.valid then
This one could probably be re-written a little bit better. control.lua line 144