ConMan


ConMan allows ordering construction and deconstruction via circuit networks. Supports ordering individual constructions, or whole blueprints.

4 years ago
0.14 - 0.18
19

b Read Blueprint Info fails on too many items

7 years ago

Hello

First of all thank you for this mod, keep up the great work!

I found a bug when you try to read blueprint info of a blueprint with 16 or more items it results in an error as the default constant combinator used by your mod can not have more signals.

I'm looking forward for a fix :)

Cheers dewit120

control.lua line 209 and following
-- add BoM signals
for k,v in pairs(bp.cost_to_build) do
outsignals[#outsignals+1]={index=#outsignals+1,count=v,signal={name=k,type="item"}}
end
end
manager.cc2.get_or_create_control_behavior().parameters={parameters=outsignals} <-- This will fail if there are too many signals

error log:
39.711 Error MainLoop.cpp:788: Exception at tick 23076963: Error while running event on_tick (ID 0)
Index out of bounds: 16
stack traceback:
conman/control.lua:214: in function 'ReportBlueprint'
conman/control.lua:328: in function 'onTickManager'
conman/control.lua:373: in function <conman/control.lua:363>

HotFix:

control.lua line 209 and following
for k,v in pairs(bp.cost_to_build) do
if #outsignals == 15 then
break
end
outsignals[#outsignals+1]={index=#outsignals+1,count=v,signal={name=k,type="item"}}

7 years ago

The correct fix for this is to give the combinator more slots, which I'll do shortly...

7 years ago

ofc it is but i had no idea how to do this^^

New response