Construction Approvals

by azaghal

Ghosts require player's approval before construction bots are dispatched. This gives the player improved control over what parts of the factory get built, and when.

Utilities
12 days ago
1.1 - 2.1
4.23K
Logistic network Blueprints

b [FIXED] Crash when force-placing blueprint with only tiles (5.1.1)

2 months ago

Hi. Looks like youve had this problem before, but it crashes the game every time im trying to place down a blueprint with tiles only

Error while running event ConstructionPlannerContinued::on_pre_build (ID 9)
ConstructionPlannerContinued/control.lua:901: bad argument #2 of 2 to 'table_size' (table expected, got nil)
stack traceback:
[C]: in function 'table_size'
ConstructionPlannerContinued/control.lua:901: in function 'get_blueprint_dimensions'
ConstructionPlannerContinued/control.lua:942: in function 'get_blueprint_bounding_box'
ConstructionPlannerContinued/control.lua:1458: in function <ConstructionPlannerContinued/control.lua:1395>

a month ago

Hello Saimnieks,

Thank you for reporting the bug, I was able to reproduce the problem locally, although on 2.1 game version.

What game version are you currently running? I am going to release a 2.1 version of the mod, but if you happen to be still "stuck" on 2.0 version of the game, I could push out a quick patch release for it.

Best regards,
Branko

12 days ago

Hi! I'm getting the same crash on Factorio 2.0 with Construction Approvals 5.1.1 (playing with a large modpack). It happens when super-force placing (Ctrl+Shift+click) a blueprint that only contains tiles.

I looked into it and fixed it locally. The cause is that get_blueprint_entities() returns nil (not an empty table) for blueprints without entities, so table_size() fails in get_blueprint_dimensions().

The fix is a one-line change in control.lua, line 899:

local blueprint_entities = blueprint.get_blueprint_entities()

becomes:

local blueprint_entities = blueprint.get_blueprint_entities() or {}

The same pattern appears at line 461 (get_entities_as_blueprint_entities), which I changed to:

return bp.get_blueprint_entities() or {}

If you'd rather not make the change yourself, feel free to contact me here or on Steam ( Darihs Skalibrista [ESP] ) and I'll send you the patched file. Otherwise you can apply it directly and re-upload.

Thanks for the mod!

12 days ago

Hello Darihs,

Thanks for offering the patch - but no need for it, the changes are trivial. I guess I will do one more (hopefully last) release for 2.0 for anyone who hasn't moved on to 2.1 version of the game.

Funny enough, the second instance you mentioned is sitting within unused function, so probably will just drop that one in full (probably some leftover from a refactor or upgrade to 2.0).

Best regards,
Branko

Best regards,
Branko

12 days ago

Ok, just pushed the fix for 2.0 version of the game, and the fix is also part of the new release for game version 2.1. Getting a short confirmation that this particular issue has been fixed in your games (just in case) would be welcome so I can close off the thread. :)

New response