mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-10 08:08:14 -06:00
begun work on 1.2.1
This commit is contained in:
@@ -93,8 +93,11 @@ function remove_train(map_data, train_id, train)
|
||||
if count <= 1 then
|
||||
global.layout_train_count[layout_id] = nil
|
||||
global.layouts[layout_id] = nil
|
||||
for _, station in pairs(global.stations) do
|
||||
station.accepted_layouts[layout_id] = nil
|
||||
for _, stop in pairs(global.stations) do
|
||||
stop.accepted_layouts[layout_id] = nil
|
||||
end
|
||||
for _, stop in pairs(global.refuelers) do
|
||||
stop.accepted_layouts[layout_id] = nil
|
||||
end
|
||||
else
|
||||
global.layout_train_count[layout_id] = count - 1
|
||||
@@ -147,9 +150,14 @@ function set_train_layout(map_data, train)
|
||||
|
||||
map_data.layouts[layout_id] = layout
|
||||
map_data.layout_train_count[layout_id] = 1
|
||||
for _, station in pairs(map_data.stations) do
|
||||
if station.layout_pattern then
|
||||
station.accepted_layouts[layout_id] = is_layout_accepted(station.layout_pattern, layout) or nil
|
||||
for _, stop in pairs(map_data.stations) do
|
||||
if stop.layout_pattern then
|
||||
stop.accepted_layouts[layout_id] = is_layout_accepted(stop.layout_pattern, layout) or nil
|
||||
end
|
||||
end
|
||||
for _, stop in pairs(map_data.refuelers) do
|
||||
if stop.layout_pattern then
|
||||
stop.accepted_layouts[layout_id] = is_refuel_layout_accepted(stop.layout_pattern, layout) or nil
|
||||
end
|
||||
end
|
||||
else
|
||||
|
||||
@@ -591,6 +591,14 @@ local function on_built(event)
|
||||
update_stop_from_pump(global, entity)
|
||||
elseif entity.type == "straight-rail" then
|
||||
update_stop_from_rail(global, entity)
|
||||
elseif entity.type == "arithmetic-combinator" then
|
||||
local control = get_comb_control(entity)
|
||||
local params = control.parameters
|
||||
params.first_constant = 12345
|
||||
params.second_constant = 67890
|
||||
params.first_signal = NETWORK_SIGNAL_DEFAULT
|
||||
params.second_signal = {name = NETWORK_EACH, type = "virtual"}
|
||||
control.parameters = params
|
||||
end
|
||||
end
|
||||
local function on_broken(event)
|
||||
@@ -788,6 +796,7 @@ local filter_built = {
|
||||
{filter = "type", type = "inserter"},
|
||||
{filter = "type", type = "pump"},
|
||||
{filter = "type", type = "straight-rail"},
|
||||
{filter = "type", type = "arithmetic-combinator"},
|
||||
}
|
||||
local filter_broken = {
|
||||
{filter = "name", name = "train-stop"},
|
||||
|
||||
@@ -198,8 +198,11 @@ function interface.update_train_layout(train_id)
|
||||
if count <= 1 then
|
||||
global.layout_train_count[old_layout_id] = nil
|
||||
global.layouts[old_layout_id] = nil
|
||||
for station_id, station in pairs(global.stations) do
|
||||
station.accepted_layouts[old_layout_id] = nil
|
||||
for _, stop in pairs(global.stations) do
|
||||
stop.accepted_layouts[old_layout_id] = nil
|
||||
end
|
||||
for _, stop in pairs(global.refuelers) do
|
||||
stop.accepted_layouts[old_layout_id] = nil
|
||||
end
|
||||
else
|
||||
global.layout_train_count[old_layout_id] = count - 1
|
||||
|
||||
Reference in New Issue
Block a user