1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-24 03:47:58 +02:00

Merge pull request #147 from ComfyFactory/mtn_v3_icw

Mtn v3 - ICW fix weird bug
This commit is contained in:
Gerkiz 2021-11-01 16:48:08 +01:00 committed by GitHub
commit 737e09d2f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -180,6 +180,7 @@ local function input_filtered(wagon_inventory, chest, chest_inventory, free_slot
request_stacks[stack.name] = 10 * prototypes[stack.name].stack_size
end
end
if wagon_inventory.supports_bar() then
for i = 1, wagon_inventory.get_bar() - 1, 1 do
if free_slots <= 0 then
return
@ -195,6 +196,7 @@ local function input_filtered(wagon_inventory, chest, chest_inventory, free_slot
end
end
end
end
local remove_lights_token =
Token.register(
@ -303,17 +305,20 @@ local function input_cargo(wagon, chest)
local chest_inventory = chest.get_inventory(defines.inventory.chest)
local free_slots = 0
if chest_inventory.supports_bar() then
for i = 1, chest_inventory.get_bar() - 1, 1 do
if not chest_inventory[i].valid_for_read then
free_slots = free_slots + 1
end
end
end
if chest.get_request_slot(1) then
input_filtered(wagon_inventory, chest, chest_inventory, free_slots)
goto continue
end
if wagon_inventory.supports_bar() then
for i = 1, wagon_inventory.get_bar() - 1, 1 do
if free_slots <= 0 then
goto continue
@ -324,6 +329,7 @@ local function input_cargo(wagon, chest)
free_slots = free_slots - 1
end
end
end
::continue::
end