1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-03-17 20:58:13 +02:00

Merge pull request #47 from M3wM3w/master

update from main
This commit is contained in:
hanakocz 2021-01-30 21:07:24 +01:00 committed by GitHub
commit 5ca1694886
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 11 deletions

View File

@ -644,7 +644,6 @@ function Public.create_wagon_room(icw, wagon)
e2.minable = false
wagon.transfer_entities = {e1, e2}
end
return
end
end

View File

@ -86,13 +86,6 @@ local function on_train_created()
Functions.request_reconstruction(icw)
end
local function on_built_entity(event)
local icw = ICW.get()
local created_entity = event.created_entity
Functions.create_wagon(icw, created_entity)
Functions.add_wagon_entity_count(icw, created_entity)
end
local function on_gui_click(event)
local icw = ICW.get()
Functions.toggle_minimap(icw, event)
@ -160,6 +153,5 @@ Event.add(defines.events.on_gui_opened, on_gui_opened)
Event.add(defines.events.on_player_built_tile, on_player_or_robot_built_tile)
Event.add(defines.events.on_robot_built_tile, on_player_or_robot_built_tile)
Event.add(defines.events.on_gui_switch_state_changed, on_gui_switch_state_changed)
Event.add(defines.events.on_built_entity, on_built_entity)
return Public

View File

@ -1479,8 +1479,8 @@ local function on_built_entity(event)
local chest_created
local increased = false
for k, v in pairs(outside_chests) do
if v and v.valid then
for k, data in pairs(outside_chests) do
if data and data.chest and data.chest.valid then
if chests_linked_to[train.unit_number] then
local linked_to = chests_linked_to[train.unit_number].count
if linked_to == chest_limit_outside_upgrades then
@ -1492,6 +1492,7 @@ local function on_built_entity(event)
chests_linked_to[train.unit_number].count = linked_to + 1
chests_linked_to[train.unit_number][entity.unit_number] = true
increased = true
goto continue
end
else