diff --git a/UsefulCombinators_0.4.0/control.lua b/UsefulCombinators_0.4.0/control.lua index 3b4931c..ab0af90 100644 --- a/UsefulCombinators_0.4.0/control.lua +++ b/UsefulCombinators_0.4.0/control.lua @@ -366,23 +366,35 @@ classes["max-combinator"] = { local signals = get_signals(control) local signal = {type = "virtual"} local count = -math.huge - for k,v in pairs(signals) do - count = math.max(count, v.count) - if count == v.count then - signal = v.signal + if signals then + for k,v in pairs(signals) do + if v.signal.name ~= "output-signal" then + count = math.max(count, v.count) + if count == v.count then + signal = v.signal + end + end end end - count = 1 + local ncount = 1 if count == -math.huge then + ncount = 0 count = 0 end + local f1 = false for _,i in pairs(params) do if i.signal.name then + f1 = true if signal.name == i.signal.name then - table.insert(slots, {signal = signal, count = count, index = 1}) + table.insert(slots, {signal = signal, count = ncount, index = 1}) + table.insert(slots, {signal = {type="virtual", name="output-signal"}, count = count, index = 2}) end end end + if not f1 then + table.insert(slots, {signal = signal, count = ncount, index = 1}) + table.insert(slots, {signal = {type="virtual", name="output-signal"}, count = count, index = 2}) + end control.parameters = { parameters = slots } @@ -2187,4 +2199,4 @@ script.on_event(defines.events.on_tick, tick) script.on_event(defines.events.on_gui_click, on_click_ok) --script.on_event(defines.events.on_entity_settings_pasted, on_paste) script.on_event("uc-edit", on_key) -script.on_configuration_changed(configuration_changed) \ No newline at end of file +script.on_configuration_changed(configuration_changed) diff --git a/UsefulCombinators_0.4.0/prototypes/entity/entities.lua b/UsefulCombinators_0.4.0/prototypes/entity/entities.lua index d0b4323..20a331f 100644 --- a/UsefulCombinators_0.4.0/prototypes/entity/entities.lua +++ b/UsefulCombinators_0.4.0/prototypes/entity/entities.lua @@ -791,7 +791,7 @@ data:extend({ collision_box = {{-0.35, -0.35}, {0.35, 0.35}}, selection_box = {{-0.5, -0.5}, {0.5, 0.5}}, - item_slot_count = 1, + item_slot_count = 2, sprites = { @@ -3587,4 +3587,4 @@ data:extend({ }, circuit_wire_max_distance = 7.5 } -}) \ No newline at end of file +})