Lazy Builder

by Morgott

Another mod for auto-construction/upgrade of ghost structures and auto-dismantling of objects, but as non-cheaty as possible.

Utilities
4 days ago
2.0
3.05K
Blueprints Cheats

g [CLOSE]Bug with belt balancer 2

3 months ago

Crashes when deconstructing items from belt balancer 2.
There is no issue when using construction bots, so it seems to be something related to lazy builder, bugging out the mod.

The mod Lazy Builder (1.0.8) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event auto-build-and-deconstruct::on_tick (ID 0)
The mod Belt Balancer 2 (2.0.9) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event belt-balancer-2::on_player_mined_entity (ID 74)
belt-balancer-2/objects/part.lua:197: attempt to index local 'part' (a nil value)
stack traceback:
belt-balancer-2/objects/part.lua:197: in function 'remove'
belt-balancer-2/control.lua:145: in function <belt-balancer-2/control.lua:134>
stack traceback:
[C]: in function 'mine_entity'
auto-build-and-deconstruct/control.lua:116: in function 'deconstruct'
auto-build-and-deconstruct/control.lua:52: in function 'scan'
auto-build-and-deconstruct/control.lua:23: in function <auto-build-and-deconstruct/control.lua:20>

16 days ago

Thanks for the report!

Looking at the stack trace, the actual crash happens in Belt Balancer 2, not in Lazy Builder:

belt-balancer-2/objects/part.lua:197: attempt to index local 'part' (a nil value)
Here's what happens:

Lazy Builder calls player.mine_entity() to deconstruct an entity
This triggers the on_player_mined_entity event (standard Factorio API)
Belt Balancer 2 receives this event and tries to process it
Belt Balancer 2 crashes because it expects a part variable that is nil
This is the same API that construction bots use internally, but bots might trigger a different event (on_robot_mined_entity) which Belt Balancer 2 handles correctly.

Unfortunately, I can't fix this on my side — Belt Balancer 2 needs to add a nil check in their part.lua:197 to handle this case properly.

Recommendations:

Report this bug to the Belt Balancer 2 author
As a workaround, deconstruct belt balancers manually or with robots instead of Lazy Builder
Also, this report is from version 1.0.8. Are you still experiencing this issue with the current version? Both mods may have been updated since then.

New response