Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- control.lua | 39 ++++++++++++++++++++++++---------------
- prototypes/entity.lua | 2 +-
- 2 files changed, 25 insertions(+), 16 deletions(-)
- diff --git a/control.lua b/control.lua
- index 3bd844e..2e1bd7c 100644
- --- a/control.lua
- +++ b/control.lua
- @@ -1110,10 +1110,10 @@ local function carContents(car)
- reqs[filter] = (reqs[filter] or 0) + game.item_prototypes[filter].stack_size
- end
- end
- - for k,r in pairs(reqs) do
- - local c = contents[k] or 0
- - if r > c then
- - contents[k] = c - r
- + for key,required in pairs(reqs) do
- + local contentCount = contents[key] or 0
- + if required > contentCount then
- + contents[key] = contentCount - required
- end
- end
- end
- @@ -1724,23 +1724,32 @@ local function runCar(car)
- -- Check tile sitcker for re-direction
- if cell.sticker ~= nil then
- + local ignoreSticker = true
- local control = cell.sticker.get_control_behavior()
- +
- if control.enabled then
- - local signal = control.get_signal(1)
- - if signal ~= nil then
- - if signal.signal ~= nil then
- - -- sticker is set; check arrow
- - contentsAndSignals()
- - local name = signal.signal.name
- - if contents[name] == nil or contents[name] == 0 then
- - pathDirection = carDirection
- + for slot = 1, control.signals_count do
- + if ignoreSticker == true then
- + local signal = control.get_signal(slot)
- + if signal ~= nil then
- + if signal.signal ~= nil then
- + -- sticker is set; check arrow
- + contentsAndSignals()
- + local name = signal.signal.name
- + if contents[name] == nil or contents[name] == 0 then
- + -- check next signal
- + else
- + ignoreSticker = false
- + end
- + end
- end
- - else
- - -- sticker is not set; ignore arrow
- - pathDirection = carDirection
- end
- end
- end
- +
- + if ignoreSticker == true then
- + pathDirection = carDirection
- + end
- end
- -- Restrict group paths
- diff --git a/prototypes/entity.lua b/prototypes/entity.lua
- index 11565cb..95a1073 100644
- --- a/prototypes/entity.lua
- +++ b/prototypes/entity.lua
- @@ -600,7 +600,7 @@ data:extend({
- icon_size = 32,
- tile_width = 1,
- tile_height = 1,
- - item_slot_count = 1,
- + item_slot_count = 18,
- sprites = {
- north = {
- filename = "__logicarts__/graphics/sticker.png",
- --
- 2.23.0
Advertisement
Add Comment
Please, Sign In to add comment