mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-02-09 13:37:02 +02:00
update EEIs when progressing
This commit is contained in:
parent
7109f779bc
commit
d9c8a89246
@ -126,25 +126,25 @@ function Public.apply_restrictions_to_machines(tickinterval)
|
|||||||
end
|
end
|
||||||
|
|
||||||
for _, surface in ipairs(surfaces_to_check) do
|
for _, surface in ipairs(surfaces_to_check) do
|
||||||
local machines1 = surface.find_entities_filtered{
|
local crafters = surface.find_entities_filtered{
|
||||||
type = {'assembling-machine', 'furnace', 'lab'},
|
type = {'assembling-machine', 'furnace', 'lab'},
|
||||||
force = memory.force_name
|
force = memory.force_name
|
||||||
}
|
}
|
||||||
|
local drills = surface.find_entities_filtered{
|
||||||
local machines2 = surface.find_entities_filtered{
|
|
||||||
type = {'mining-drill'},
|
type = {'mining-drill'},
|
||||||
force = memory.force_name
|
force = memory.force_name
|
||||||
}
|
}
|
||||||
|
|
||||||
local disable_crafters = boat.state == Boats.enum_state.ATSEA_WAITING_TO_SAIL
|
local disable_crafters = boat.state == Boats.enum_state.ATSEA_WAITING_TO_SAIL
|
||||||
for _, machine in ipairs(machines1) do
|
|
||||||
|
for _, machine in ipairs(crafters) do
|
||||||
if machine and machine.valid then
|
if machine and machine.valid then
|
||||||
machine.active = not disable_crafters
|
machine.active = not disable_crafters
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
remove_productivity_modules(surface, machines1)
|
remove_productivity_modules(surface, crafters)
|
||||||
remove_productivity_modules(surface, machines2)
|
remove_productivity_modules(surface, drills)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1140,7 +1140,6 @@ function Public.loading_update(tickinterval)
|
|||||||
if fraction > Common.fraction_of_map_loaded_at_sea then
|
if fraction > Common.fraction_of_map_loaded_at_sea then
|
||||||
boat.state = Boats.enum_state.ATSEA_WAITING_TO_SAIL
|
boat.state = Boats.enum_state.ATSEA_WAITING_TO_SAIL
|
||||||
|
|
||||||
memory.force_toggle_machine_states = true
|
|
||||||
Boats.update_EEIs(boat)
|
Boats.update_EEIs(boat)
|
||||||
|
|
||||||
local force = memory.force
|
local force = memory.force
|
||||||
|
@ -284,6 +284,8 @@ function Public.progress_to_destination(destination_index)
|
|||||||
boat.state = destination_data.init_boat_state
|
boat.state = destination_data.init_boat_state
|
||||||
boat.dockedposition = nil
|
boat.dockedposition = nil
|
||||||
|
|
||||||
|
Boats.update_EEIs(boat)
|
||||||
|
|
||||||
local old_water = 'deepwater'
|
local old_water = 'deepwater'
|
||||||
if old_type == Surfaces.enum.LOBBY or old_type == Surfaces.enum.DOCK then old_water = 'water' end
|
if old_type == Surfaces.enum.LOBBY or old_type == Surfaces.enum.DOCK then old_water = 'water' end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user