mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-14 10:12:42 -06:00
minor improvements
This commit is contained in:
@@ -9,3 +9,9 @@ Date: 2022-11-10
|
|||||||
Features:
|
Features:
|
||||||
- Removed provide-threshold
|
- Removed provide-threshold
|
||||||
- Added ability to specify station type on a cybernetic combinator
|
- Added ability to specify station type on a cybernetic combinator
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------------------------------
|
||||||
|
Version: 0.2.1
|
||||||
|
Date: 2022-11-11
|
||||||
|
Features:
|
||||||
|
- Minor bugfixes and performance improvements
|
||||||
|
|||||||
@@ -257,27 +257,32 @@ local function tick_poll_station(map_data, mod_settings)
|
|||||||
local all_p_stations = map_data.economy.all_p_stations
|
local all_p_stations = map_data.economy.all_p_stations
|
||||||
local all_names = map_data.economy.all_names
|
local all_names = map_data.economy.all_names
|
||||||
|
|
||||||
while true do
|
local station_id
|
||||||
|
local station
|
||||||
|
while true do--choose a station
|
||||||
tick_data.i = (tick_data.i or 0) + 1
|
tick_data.i = (tick_data.i or 0) + 1
|
||||||
if tick_data.i > #map_data.all_station_ids then
|
if tick_data.i > #map_data.all_station_ids then
|
||||||
tick_data.i = nil
|
tick_data.i = nil
|
||||||
map_data.tick_state = STATE_DISPATCH
|
map_data.tick_state = STATE_DISPATCH
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
local station_id = map_data.all_station_ids[tick_data.i]
|
station_id = map_data.all_station_ids[tick_data.i]
|
||||||
local station = map_data.stations[station_id]
|
station = map_data.stations[station_id]
|
||||||
if station == nil then
|
if station then
|
||||||
table_remove(map_data.all_station_ids, tick_data.i)
|
|
||||||
tick_data.i = tick_data.i - 1
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
if station.display_update then
|
if station.display_update then
|
||||||
update_combinator_display(station.entity_comb1, station.display_failed_request)
|
update_combinator_display(station.entity_comb1, station.display_failed_request)
|
||||||
station.display_update = station.display_failed_request
|
station.display_update = station.display_failed_request
|
||||||
station.display_failed_request = nil
|
station.display_failed_request = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
if station.network_name and station.deliveries_total < station.entity_stop.trains_limit then
|
if station.network_name and station.deliveries_total < station.entity_stop.trains_limit then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
else
|
||||||
|
--lazy delete removed stations
|
||||||
|
table_remove(map_data.all_station_ids, tick_data.i)
|
||||||
|
tick_data.i = tick_data.i - 1
|
||||||
|
end
|
||||||
|
end
|
||||||
station.r_threshold = mod_settings.r_threshold
|
station.r_threshold = mod_settings.r_threshold
|
||||||
station.priority = 0
|
station.priority = 0
|
||||||
station.locked_slots = 0
|
station.locked_slots = 0
|
||||||
@@ -342,8 +347,6 @@ local function tick_poll_station(map_data, mod_settings)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
---@param map_data MapData
|
---@param map_data MapData
|
||||||
---@param mod_settings CybersynModSettings
|
---@param mod_settings CybersynModSettings
|
||||||
|
|||||||
Reference in New Issue
Block a user