From 372433d6e3a182c5c65b9152e63ab4a1ae41dae1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C5=82awomir=20Lach?= <slawek@lach.art.pl>
Date: Sat, 24 Sep 2022 13:44:05 +0200
Subject: [PATCH] =?UTF-8?q?!OSDN=2045603:=20S=C5=82awomir=20Lach=20<slawek?=
 =?UTF-8?q?@lach.art.pl>?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Stop saving "game.hardcoded_counters" + ensure game save will load after
this change.

diff --git a/server/savegame/savecompat.c b/server/savegame/savecompat.c
index 4e5806ecbe..bcc98df518 100644
--- a/server/savegame/savecompat.c
+++ b/server/savegame/savecompat.c
@@ -2716,6 +2716,11 @@ static void compat_load_dev(struct loaddata *loading)
   if (game_version < 3019300) {
     /* Before version number bump to 3.1.93 */
 
+    if (FALSE != secfile_lookup_bool_default(loading->file, FALSE, "game.hardcoded_counters")) {
+
+      secfile_replace_bool(loading->file, TRUE, "game.hardcoded_counters");
+    }
+
   } /* Version < 3.1.93 */
 
 #endif /* FREECIV_DEV_SAVE_COMPAT_3_2 */
diff --git a/server/savegame/savegame3.c b/server/savegame/savegame3.c
index 5d8cf08309..6e6a66484e 100644
--- a/server/savegame/savegame3.c
+++ b/server/savegame/savegame3.c
@@ -2674,9 +2674,6 @@ static void sg_save_counters(struct savedata *saving)
   count = counters_get_city_counters_count();
   countnames = fc_calloc(count, sizeof(*countnames));
 
-  secfile_insert_bool(saving->file, TRUE, "game.hardcoded_counters");
-
-
   secfile_insert_int(saving->file, count,
                      "savefile.city_counters_order_size");
 
-- 
2.37.3

