mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-13 12:12:41 -06:00
minor improvements
This commit is contained in:
@@ -9,3 +9,9 @@ Date: 2022-11-10
|
||||
Features:
|
||||
- Removed provide-threshold
|
||||
- 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_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
|
||||
if tick_data.i > #map_data.all_station_ids then
|
||||
tick_data.i = nil
|
||||
map_data.tick_state = STATE_DISPATCH
|
||||
return true
|
||||
end
|
||||
local station_id = map_data.all_station_ids[tick_data.i]
|
||||
local station = map_data.stations[station_id]
|
||||
if station == nil then
|
||||
table_remove(map_data.all_station_ids, tick_data.i)
|
||||
tick_data.i = tick_data.i - 1
|
||||
return false
|
||||
end
|
||||
station_id = map_data.all_station_ids[tick_data.i]
|
||||
station = map_data.stations[station_id]
|
||||
if station then
|
||||
if station.display_update then
|
||||
update_combinator_display(station.entity_comb1, station.display_failed_request)
|
||||
station.display_update = station.display_failed_request
|
||||
station.display_failed_request = nil
|
||||
end
|
||||
|
||||
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.priority = 0
|
||||
station.locked_slots = 0
|
||||
@@ -343,8 +348,6 @@ local function tick_poll_station(map_data, mod_settings)
|
||||
end
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
---@param map_data MapData
|
||||
---@param mod_settings CybersynModSettings
|
||||
local function tick_dispatch(map_data, mod_settings)
|
||||
|
||||
Reference in New Issue
Block a user