mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-08 18:08:21 -06:00
added fixes
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cybersyn",
|
"name": "cybersyn",
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"title": "Project Cybersyn",
|
"title": "Project Cybersyn",
|
||||||
"author": "Mami",
|
"author": "Mami",
|
||||||
"factorio_version": "1.1",
|
"factorio_version": "1.1",
|
||||||
|
|||||||
@@ -5,15 +5,6 @@ subgroup_signal = {
|
|||||||
group = "signals",
|
group = "signals",
|
||||||
order = "f"
|
order = "f"
|
||||||
}
|
}
|
||||||
priority_signal = {
|
|
||||||
type = "virtual-signal",
|
|
||||||
name = SIGNAL_PRIORITY,
|
|
||||||
icon = "__cybersyn__/graphics/icons/priority.png",
|
|
||||||
icon_size = 64,
|
|
||||||
icon_mipmaps = 4,
|
|
||||||
subgroup = "cybersyn-signal",
|
|
||||||
order = "a"
|
|
||||||
}
|
|
||||||
r_threshold_signal = {
|
r_threshold_signal = {
|
||||||
type = "virtual-signal",
|
type = "virtual-signal",
|
||||||
name = REQUEST_THRESHOLD,
|
name = REQUEST_THRESHOLD,
|
||||||
@@ -21,7 +12,16 @@ r_threshold_signal = {
|
|||||||
icon_size = 64,
|
icon_size = 64,
|
||||||
icon_mipmaps = 4,
|
icon_mipmaps = 4,
|
||||||
subgroup = "cybersyn-signal",
|
subgroup = "cybersyn-signal",
|
||||||
order = "c"
|
order = "a"
|
||||||
|
}
|
||||||
|
priority_signal = {
|
||||||
|
type = "virtual-signal",
|
||||||
|
name = SIGNAL_PRIORITY,
|
||||||
|
icon = "__cybersyn__/graphics/icons/priority.png",
|
||||||
|
icon_size = 64,
|
||||||
|
icon_mipmaps = 4,
|
||||||
|
subgroup = "cybersyn-signal",
|
||||||
|
order = "b"
|
||||||
}
|
}
|
||||||
locked_slots_signal = {
|
locked_slots_signal = {
|
||||||
type = "virtual-signal",
|
type = "virtual-signal",
|
||||||
@@ -30,5 +30,5 @@ locked_slots_signal = {
|
|||||||
icon_size = 64,
|
icon_size = 64,
|
||||||
icon_mipmaps = 4,
|
icon_mipmaps = 4,
|
||||||
subgroup = "cybersyn-signal",
|
subgroup = "cybersyn-signal",
|
||||||
order = "d"
|
order = "c"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ function remove_manifest(map_data, station, manifest, sign)
|
|||||||
end
|
end
|
||||||
set_comb2(map_data, station)
|
set_comb2(map_data, station)
|
||||||
station.deliveries_total = station.deliveries_total - 1
|
station.deliveries_total = station.deliveries_total - 1
|
||||||
|
if station.deliveries_total == 0 and station.entity_comb1.valid then
|
||||||
|
set_combinator_operation(station.entity_comb1, OPERATION_PRIMARY_IO)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param map_data MapData
|
---@param map_data MapData
|
||||||
@@ -448,8 +451,8 @@ local function tick_dispatch(map_data, mod_settings)
|
|||||||
highest_prior = prior
|
highest_prior = prior
|
||||||
can_be_serviced = true
|
can_be_serviced = true
|
||||||
elseif d < INF then
|
elseif d < INF then
|
||||||
can_be_serviced = true
|
|
||||||
best = j
|
best = j
|
||||||
|
can_be_serviced = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -45,9 +45,10 @@ function create_inactivity_order(depot_name)
|
|||||||
return {station = depot_name, wait_conditions = create_inactivity_order_condition}
|
return {station = depot_name, wait_conditions = create_inactivity_order_condition}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local create_direct_to_station_order_condition = {{type = "time", compare_type = "and", ticks = 1}}
|
||||||
---@param stop LuaEntity
|
---@param stop LuaEntity
|
||||||
local function create_direct_to_station_order(stop)
|
local function create_direct_to_station_order(stop)
|
||||||
return {rail = stop.connected_rail, rail_direction = stop.connected_rail_direction}
|
return {rail = stop.connected_rail, rail_direction = stop.connected_rail_direction,wait_conditions = create_direct_to_station_order_condition}
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param depot_name string
|
---@param depot_name string
|
||||||
|
|||||||
@@ -220,10 +220,10 @@ function register_gui_actions()
|
|||||||
local comb = global.to_comb[msg[2]]
|
local comb = global.to_comb[msg[2]]
|
||||||
if not comb or not comb.valid then return end
|
if not comb or not comb.valid then return end
|
||||||
|
|
||||||
local a = comb.get_or_create_control_behavior()--[[@as LuaArithmeticCombinatorControlBehavior]]
|
local control = comb.get_or_create_control_behavior()--[[@as LuaArithmeticCombinatorControlBehavior]]
|
||||||
|
|
||||||
local allows_all_trains = not element.state
|
local allows_all_trains = not element.state
|
||||||
set_comb_allows_all_trains(a, allows_all_trains)
|
set_comb_allows_all_trains(control, allows_all_trains)
|
||||||
|
|
||||||
local stop = global.to_stop[comb.unit_number]
|
local stop = global.to_stop[comb.unit_number]
|
||||||
if stop then
|
if stop then
|
||||||
|
|||||||
@@ -16,9 +16,6 @@ local function set_comb1(map_data, station, manifest, sign)
|
|||||||
end
|
end
|
||||||
set_combinator_output(map_data, comb, signals)
|
set_combinator_output(map_data, comb, signals)
|
||||||
else
|
else
|
||||||
if station.deliveries_total == 0 then
|
|
||||||
set_combinator_operation(comb, OPERATION_PRIMARY_IO)
|
|
||||||
end
|
|
||||||
set_combinator_output(map_data, comb, nil)
|
set_combinator_output(map_data, comb, nil)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -131,7 +128,6 @@ local function on_station_built(map_data, stop, comb1, comb2)
|
|||||||
last_delivery_tick = 0,
|
last_delivery_tick = 0,
|
||||||
priority = 0,
|
priority = 0,
|
||||||
r_threshold = 0,
|
r_threshold = 0,
|
||||||
p_threshold = 0,
|
|
||||||
locked_slots = 0,
|
locked_slots = 0,
|
||||||
--network_name = param.first_signal and param.first_signal.name or nil,
|
--network_name = param.first_signal and param.first_signal.name or nil,
|
||||||
network_flag = 0,
|
network_flag = 0,
|
||||||
@@ -570,6 +566,8 @@ local function on_train_arrives_buffer(map_data, stop, train)
|
|||||||
set_comb1(map_data, station, train.manifest, -1)
|
set_comb1(map_data, station, train.manifest, -1)
|
||||||
set_r_wagon_combs(map_data, station, train)
|
set_r_wagon_combs(map_data, station, train)
|
||||||
end
|
end
|
||||||
|
elseif train.status == STATUS_P and train.p_station_id == station_id then
|
||||||
|
elseif train.status == STATUS_R and train.r_station_id == station_id then
|
||||||
else
|
else
|
||||||
on_failed_delivery(map_data, train)
|
on_failed_delivery(map_data, train)
|
||||||
remove_train(map_data, train, train.entity.id)
|
remove_train(map_data, train, train.entity.id)
|
||||||
|
|||||||
@@ -16,6 +16,13 @@ local migrations_table = {
|
|||||||
map_data.all_station_ids[#map_data.all_station_ids + 1] = id
|
map_data.all_station_ids[#map_data.all_station_ids + 1] = id
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
["0.2.1"] = function()
|
||||||
|
---@type MapData
|
||||||
|
local map_data = global
|
||||||
|
for id, station in pairs(map_data.stations) do
|
||||||
|
station.p_threshold = nil
|
||||||
|
end
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
---@param data ConfigurationChangedData
|
---@param data ConfigurationChangedData
|
||||||
|
|||||||
Reference in New Issue
Block a user