From 16ff3db534c1fd9e7a4a33edb8a48b3b795ce1e6 Mon Sep 17 00:00:00 2001 From: monica Date: Sat, 7 Jan 2023 19:56:01 -0500 Subject: [PATCH] updated changelog --- cybersyn/changelog.txt | 2 ++ cybersyn/scripts/migrations.lua | 14 ++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/cybersyn/changelog.txt b/cybersyn/changelog.txt index 0ee164b..128b6ed 100644 --- a/cybersyn/changelog.txt +++ b/cybersyn/changelog.txt @@ -3,6 +3,8 @@ Version: 1.2.9 Date: 2022-1-7 Bugfixes: - Fixed a bug with deliveries sometimes failing to be removed + - Fixed several rare crashes + - Fixed cybernetic combinator gui not allowing checkbox toggling when clicking on a checkbox caption - Updated flib dependency to the correct version --------------------------------------------------------------------------------------------------- Version: 1.2.8 diff --git a/cybersyn/scripts/migrations.lua b/cybersyn/scripts/migrations.lua index 97b2e37..44ae173 100644 --- a/cybersyn/scripts/migrations.lua +++ b/cybersyn/scripts/migrations.lua @@ -187,12 +187,14 @@ local migrations_table = { if not train.depot_id then if train.entity.valid then local e = get_any_train_entity(train.entity) - local stops = e.force.get_train_stops({name = train.depot_name, surface = e.surface}) - for stop in rnext_consume, stops do - local new_depot_id = stop.unit_number - if map_data.depots[new_depot_id] then - train.depot_id = new_depot_id--[[@as uint]] - break + if e then + local stops = e.force.get_train_stops({name = train.depot_name, surface = e.surface}) + for stop in rnext_consume, stops do + local new_depot_id = stop.unit_number + if map_data.depots[new_depot_id] then + train.depot_id = new_depot_id--[[@as uint]] + break + end end end end