From 7f0fa8bbcf79eac55f2b8f5eb5a75abf7999f7ca Mon Sep 17 00:00:00 2001 From: Wyrrrd Date: Sun, 28 Mar 2021 17:49:53 +0200 Subject: [PATCH] Fix game crash on existing save --- changelog.txt | 5 +++++ control.lua | 2 +- info.json | 2 +- migrations/1.1.2.lua | 4 ++++ 4 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 migrations/1.1.2.lua diff --git a/changelog.txt b/changelog.txt index cdf48e5..6826996 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 1.1.2 +Date: 2021-03-28 + Bugfixes: + - Added migration to add car index to existing saves +--------------------------------------------------------------------------------------------------- Version: 1.1.1 Date: 2021-03-28 Changes: diff --git a/control.lua b/control.lua index 2e043d8..879a685 100644 --- a/control.lua +++ b/control.lua @@ -2,7 +2,7 @@ --This mod scans the map for cars and gun-turrets and places alerts when they are low. script.on_init(function (event) - -- turret index init + -- car and turret index init global.turret_entities = {} global.car_entities = {} end) diff --git a/info.json b/info.json index e8c1ae6..3c4a18e 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "Gun_Turret_Alerts", - "version": "1.1.1", + "version": "1.1.2", "title": "Ammo Alerts", "author": "Wyrrrd", "factorio_version": "1.1", diff --git a/migrations/1.1.2.lua b/migrations/1.1.2.lua new file mode 100644 index 0000000..a3f6041 --- /dev/null +++ b/migrations/1.1.2.lua @@ -0,0 +1,4 @@ +script.on_configuration_changed(function (event) + -- car index init fix + global.car_entities = {} +end) \ No newline at end of file