mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-10 08:08:14 -06:00
added minor improvement
This commit is contained in:
@@ -14,15 +14,6 @@ r_threshold_signal = {
|
|||||||
subgroup = "cybersyn-signal",
|
subgroup = "cybersyn-signal",
|
||||||
order = "a"
|
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",
|
||||||
name = LOCKED_SLOTS,
|
name = LOCKED_SLOTS,
|
||||||
@@ -30,5 +21,14 @@ locked_slots_signal = {
|
|||||||
icon_size = 64,
|
icon_size = 64,
|
||||||
icon_mipmaps = 4,
|
icon_mipmaps = 4,
|
||||||
subgroup = "cybersyn-signal",
|
subgroup = "cybersyn-signal",
|
||||||
|
order = "b"
|
||||||
|
}
|
||||||
|
priority_signal = {
|
||||||
|
type = "virtual-signal",
|
||||||
|
name = SIGNAL_PRIORITY,
|
||||||
|
icon = "__cybersyn__/graphics/icons/priority.png",
|
||||||
|
icon_size = 64,
|
||||||
|
icon_mipmaps = 4,
|
||||||
|
subgroup = "cybersyn-signal",
|
||||||
order = "c"
|
order = "c"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -324,9 +324,12 @@ local function tick_poll_station(map_data, mod_settings)
|
|||||||
local item_name = v.signal.name
|
local item_name = v.signal.name
|
||||||
local item_count = v.count
|
local item_count = v.count
|
||||||
local effective_item_count = item_count + (station.deliveries[item_name] or 0)
|
local effective_item_count = item_count + (station.deliveries[item_name] or 0)
|
||||||
local r_threshold = get_threshold(map_data, station, v.signal)
|
|
||||||
|
|
||||||
if station.is_r and -effective_item_count >= r_threshold and -item_count >= r_threshold then
|
local flag = true
|
||||||
|
if station.is_r then
|
||||||
|
local r_threshold = get_threshold(map_data, station, v.signal)
|
||||||
|
if -effective_item_count >= r_threshold and -item_count >= r_threshold then
|
||||||
|
flag = false
|
||||||
local item_network_name = station.network_name..":"..item_name
|
local item_network_name = station.network_name..":"..item_name
|
||||||
local stations = all_r_stations[item_network_name]
|
local stations = all_r_stations[item_network_name]
|
||||||
if stations == nil then
|
if stations == nil then
|
||||||
@@ -337,7 +340,10 @@ local function tick_poll_station(map_data, mod_settings)
|
|||||||
end
|
end
|
||||||
stations[#stations + 1] = station_id
|
stations[#stations + 1] = station_id
|
||||||
station.p_count_or_r_threshold_per_item[item_name] = r_threshold
|
station.p_count_or_r_threshold_per_item[item_name] = r_threshold
|
||||||
elseif station.is_p and effective_item_count > 0 and item_count > 0 then
|
end
|
||||||
|
end
|
||||||
|
if flag then
|
||||||
|
if station.is_p and effective_item_count > 0 and item_count > 0 then
|
||||||
local item_network_name = station.network_name..":"..item_name
|
local item_network_name = station.network_name..":"..item_name
|
||||||
local stations = all_p_stations[item_network_name]
|
local stations = all_p_stations[item_network_name]
|
||||||
if stations == nil then
|
if stations == nil then
|
||||||
@@ -351,6 +357,7 @@ local function tick_poll_station(map_data, mod_settings)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
---@param map_data MapData
|
---@param map_data MapData
|
||||||
|
|||||||
Reference in New Issue
Block a user