1.2.5 Experimental (#22)

* prepared for 1.2.2

* updated todo

* fixed bad code

* made wagon control spread out items

* updated changelog

* implemented disabled inactivity condition

* added depot settings

* added a bunch of settings

* fixed a crash from network each

* started adding network each to depots

* finished adding network each to depots

* improved defaults

* added capacity priority

* fixed se bugs

* updated changelog

* flipped sign of outputs

* fixed migrations

* added support for cargo at depots

* fixed crash

* improved allow cargo in depots

* fixed changelog

* fixed migration

* finished testing new features

* added more map settings

* updated readme

* updated locale

* updated readme

* updated readme

* bugfixes

* updated version

* added migration

* fixed crash

* 1.2.4

* 1.2.5 bugfix

* fixed migration version
This commit is contained in:
Monica Moniot
2022-12-30 15:51:16 -05:00
committed by GitHub
parent 7d2f0c2ccd
commit b8a6f5fb97
6 changed files with 61 additions and 6 deletions

View File

@@ -1,4 +1,19 @@
---------------------------------------------------------------------------------------------------
Version: 1.2.5
Date: 2022-12-30
Bugfixes:
- Fixed a bug with migrating depots of old worlds
---------------------------------------------------------------------------------------------------
Version: 1.2.4
Date: 2022-12-29
Bugfixes:
- Fixed crash when changing combinator modes
---------------------------------------------------------------------------------------------------
Version: 1.2.3
Date: 2022-12-29
Bugfixes:
- Fixed a bug where new stations weren't receiving network ids
---------------------------------------------------------------------------------------------------
Version: 1.2.2
Date: 2022-12-29
Features:

View File

@@ -1,6 +1,6 @@
{
"name": "cybersyn",
"version": "1.2.2",
"version": "1.2.5",
"title": "Project Cybersyn",
"author": "Mami",
"factorio_version": "1.1",

View File

@@ -503,6 +503,9 @@ local function tick_poll_station(map_data, mod_settings)
station_id = map_data.active_station_ids[tick_data.i]
station = map_data.stations[station_id]
if station then
if station_id == 70487 then
local i = 0
end
--NOTE: polling trains_limit here is expensive and not strictly necessary but using it to early out saves more ups
if station.network_name and station.deliveries_total < station.entity_stop.trains_limit then
break

View File

@@ -139,6 +139,10 @@ local function on_station_built(map_data, stop, comb1, comb2)
local id = stop.unit_number--[[@as uint]]
map_data.stations[id] = station
map_data.warmup_station_ids[#map_data.warmup_station_ids + 1] = id
if not map_data.queue_station_update then
map_data.queue_station_update = {}
end
map_data.queue_station_update[id] = true
update_stop_if_auto(map_data, station, true)
interface_raise_station_created(id)
@@ -371,7 +375,7 @@ function combinator_update(map_data, comb, reset_display)
if stop then
id = stop.unit_number--[[@as uint]]
station = map_data.stations[id]
if station.entity_comb1 ~= comb then
if station and station.entity_comb1 ~= comb then
station = nil
end
if should_reset and station then

View File

@@ -168,8 +168,8 @@ local migrations_table = {
local bits_old = params_old.second_constant or 0
bits = bit32.replace(bits, 1, SETTING_ENABLE_INACTIVE)--[[@as int]]
bits = bit32.replace(bits, 1, SETTING_ENABLE_INACTIVE)--[[@as int]]
bits_old = bit32.replace(bits_old, 1, SETTING_USE_ANY_DEPOT)--[[@as int]]
bits = bit32.replace(bits, 1, SETTING_USE_ANY_DEPOT)--[[@as int]]
bits_old = bit32.replace(bits_old, 1, SETTING_ENABLE_INACTIVE)--[[@as int]]
bits_old = bit32.replace(bits_old, 1, SETTING_USE_ANY_DEPOT)--[[@as int]]
params.second_constant = bits
params_old.second_constant = bits_old
@@ -223,7 +223,40 @@ local migrations_table = {
train.se_depot_surface_i = nil
train.parked_at_depot_id = nil
end
end
end,
["1.2.3"] = function()
---@type MapData
local map_data = global
for _, station in pairs(map_data.stations) do
set_station_from_comb(station)
end
end,
["1.2.5"] = function()
---@type MapData
local map_data = global
local setting = settings.global["cybersyn-invert-sign"]
setting.value = true
settings.global["cybersyn-invert-sign"] = setting
for id, comb in pairs(map_data.to_comb) do
local control = get_comb_control(comb)
local params = control.parameters
local params_old = map_data.to_comb_params[id]
local bits = params.second_constant or 0
local bits_old = params_old.second_constant or 0
bits = bit32.replace(bits, 1, SETTING_USE_ANY_DEPOT)--[[@as int]]
bits_old = bit32.replace(bits_old, 1, SETTING_USE_ANY_DEPOT)--[[@as int]]
params.second_constant = bits
params_old.second_constant = bits_old
control.parameters = params
map_data.to_comb_params[id] = params_old
end
for train_id, train in pairs(map_data.trains) do
train.use_any_depot = true
end
end,
}
--STATUS_R_TO_D = 5