From f369962c2ace68eb8952410e2447f22bba878983 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 12 Jun 2022 11:18:56 +0300 Subject: [PATCH 46/46] Savegame: Rename "wonder_city" as "adv.wonder_city" See osdn #44783 Signed-off-by: Marko Lindqvist --- data/scenarios/europe_1900_WWI.sav | 54 +++++++++++++++--------------- data/scenarios/tileset-demo.sav | 10 +++--- server/savegame/savecompat.c | 17 ++++++++++ server/savegame/savegame3.c | 4 +-- 4 files changed, 51 insertions(+), 34 deletions(-) diff --git a/data/scenarios/europe_1900_WWI.sav b/data/scenarios/europe_1900_WWI.sav index 8d92d0377d..98c94b6567 100644 --- a/data/scenarios/europe_1900_WWI.sav +++ b/data/scenarios/europe_1900_WWI.sav @@ -2657,7 +2657,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,0,-1,5,0,0,0,0,0 1,1,-1,5,0,0,0,0,0 } -wonder_city=167 +adv.wonder_city=167 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -4746,7 +4746,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,1,-1,5,0,0,0,0,0 1,2,-1,5,0,0,0,0,0 } -wonder_city=221 +adv.wonder_city=221 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -6914,7 +6914,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,2,-1,5,0,0,0,0,0 1,3,-1,5,0,0,0,0,0 } -wonder_city=657 +adv.wonder_city=657 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -9084,7 +9084,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,3,-1,5,0,0,0,0,0 1,4,-1,5,0,0,0,0,0 } -wonder_city=272 +adv.wonder_city=272 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -11196,7 +11196,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,4,-1,5,0,0,0,0,0 1,0,-1,5,0,0,0,0,0 } -wonder_city=508 +adv.wonder_city=508 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -13359,7 +13359,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,0,-1,5,0,0,0,0,0 1,1,-1,5,0,0,0,0,0 } -wonder_city=350 +adv.wonder_city=350 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -15430,7 +15430,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,1,-1,5,0,0,0,0,0 1,2,-1,5,0,0,0,0,0 } -wonder_city=530 +adv.wonder_city=530 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -17508,7 +17508,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,2,-1,5,0,0,0,0,0 1,3,-1,5,0,0,0,0,0 } -wonder_city=573 +adv.wonder_city=573 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -19570,7 +19570,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,3,-1,5,0,0,0,0,0 1,4,-1,5,0,0,0,0,0 } -wonder_city=376 +adv.wonder_city=376 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -21584,7 +21584,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,4,-1,5,0,0,0,0,0 1,0,-1,5,0,0,0,0,0 } -wonder_city=2777 +adv.wonder_city=2777 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -23623,7 +23623,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,0,-1,5,0,0,0,0,0 1,1,-1,5,0,0,0,0,0 } -wonder_city=2832 +adv.wonder_city=2832 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -25651,7 +25651,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,1,-1,5,0,0,0,0,0 1,2,-1,5,0,0,0,0,0 } -wonder_city=246 +adv.wonder_city=246 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -27663,7 +27663,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,2,-1,5,0,0,0,0,0 1,3,-1,5,0,0,0,0,0 } -wonder_city=0 +adv.wonder_city=0 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -29682,7 +29682,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,3,-1,5,0,0,0,0,0 1,4,-1,5,0,0,0,0,0 } -wonder_city=330 +adv.wonder_city=330 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -31709,7 +31709,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,4,-1,5,0,0,0,0,0 1,0,-1,5,0,0,0,0,0 } -wonder_city=635 +adv.wonder_city=635 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -33725,7 +33725,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,0,-1,5,0,0,0,0,0 1,1,-1,5,0,0,0,0,0 } -wonder_city=608 +adv.wonder_city=608 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -35746,7 +35746,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,1,-1,5,0,0,0,0,0 1,2,-1,5,0,0,0,0,0 } -wonder_city=618 +adv.wonder_city=618 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -37759,7 +37759,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,2,-1,5,0,0,0,0,0 1,3,-1,5,0,0,0,0,0 } -wonder_city=712 +adv.wonder_city=712 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -39772,7 +39772,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,3,-1,5,0,0,0,0,0 1,4,-1,5,0,0,0,0,0 } -wonder_city=2797 +adv.wonder_city=2797 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -41793,7 +41793,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,4,-1,5,0,0,0,0,0 1,0,-1,5,0,0,0,0,0 } -wonder_city=2845 +adv.wonder_city=2845 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -43816,7 +43816,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,0,-1,5,0,0,0,0,0 1,1,-1,5,0,0,0,0,0 } -wonder_city=2864 +adv.wonder_city=2864 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -45887,7 +45887,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,1,-1,5,0,0,0,0,0 1,2,-1,5,0,0,0,0,0 } -wonder_city=0 +adv.wonder_city=0 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -47887,7 +47887,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,2,-1,5,0,0,0,0,0 1,3,-1,5,0,0,0,0,0 } -wonder_city=0 +adv.wonder_city=0 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -49883,7 +49883,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,3,-1,5,0,0,0,0,0 1,4,-1,5,0,0,0,0,0 } -wonder_city=0 +adv.wonder_city=0 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -51882,7 +51882,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,4,-1,5,0,0,0,0,0 1,0,-1,5,0,0,0,0,0 } -wonder_city=0 +adv.wonder_city=0 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -53881,7 +53881,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,0,-1,5,0,0,0,0,0 1,1,-1,5,0,0,0,0,0 } -wonder_city=0 +adv.wonder_city=0 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 @@ -55889,7 +55889,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,1,-1,5,0,0,0,0,0 1,2,-1,5,0,0,0,0,0 } -wonder_city=0 +adv.wonder_city=0 texai={"spam","countdown","war_reason","patience","warn_space","ask_peace","ask_alliance","ask_ceasefire" 0,-1,0,0,0,0,0,0 0,-1,0,0,0,0,0,0 diff --git a/data/scenarios/tileset-demo.sav b/data/scenarios/tileset-demo.sav index e031f1e610..fd047403f5 100644 --- a/data/scenarios/tileset-demo.sav +++ b/data/scenarios/tileset-demo.sav @@ -1246,7 +1246,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 1,3,-1,5,0,0,0,0,0 1,4,-1,5,0,0,0,0,0 } -wonder_city=0 +adv.wonder_city=0 ai.level="Easy" ai.barb_type="None" gold=50 @@ -2099,7 +2099,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 0,4,-1,5,0,0,0,0,0 0,0,-1,5,0,0,0,0,0 } -wonder_city=0 +adv.wonder_city=0 ai.level="Easy" ai.barb_type="None" gold=50 @@ -2925,7 +2925,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 0,0,-1,5,0,0,0,0,0 0,1,-1,5,0,0,0,0,0 } -wonder_city=0 +adv.wonder_city=0 ai.level="Easy" ai.barb_type="None" gold=50 @@ -3773,7 +3773,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 0,1,-1,5,0,0,0,0,0 0,2,-1,5,0,0,0,0,0 } -wonder_city=0 +adv.wonder_city=0 ai.level="Easy" ai.barb_type="None" gold=50 @@ -4617,7 +4617,7 @@ ai={"love","spam","countdown","war_reason","patience","warn_space","ask_peace"," 0,2,-1,5,0,0,0,0,0 0,3,-1,5,0,0,0,0,0 } -wonder_city=0 +adv.wonder_city=0 ai.level="Easy" ai.barb_type="None" gold=50 diff --git a/server/savegame/savecompat.c b/server/savegame/savecompat.c index fc01d0ceb8..b3e7f7122e 100644 --- a/server/savegame/savecompat.c +++ b/server/savegame/savecompat.c @@ -2479,6 +2479,23 @@ static void compat_load_dev(struct loaddata *loading) free(savemod); } } + + player_slots_iterate(pslot) { + int plrno = player_slot_index(pslot); + int wonder_city = secfile_lookup_int_default(loading->file, -1, + "player%d.adv.wonder_city", + plrno); + if (wonder_city < 0) { + /* No wonder_city saved with the new name. Check for the old name */ + wonder_city = secfile_lookup_int_default(loading->file, -1, + "player%d.wonder_city", + plrno); + if (wonder_city >= 0) { + secfile_replace_int(loading->file, wonder_city, + "player%d.adv.wonder_city", plrno); + } + } + } player_slots_iterate_end; } /* Version < 3.1.92 */ #endif /* FREECIV_DEV_SAVE_COMPAT_3_2 */ diff --git a/server/savegame/savegame3.c b/server/savegame/savegame3.c index 323607fa4f..e8b4a6cd51 100644 --- a/server/savegame/savegame3.c +++ b/server/savegame/savegame3.c @@ -4092,7 +4092,7 @@ static void sg_load_player_main(struct loaddata *loading, } players_iterate_end; plr->server.adv->wonder_city = secfile_lookup_int_default(loading->file, 0, - "player%d.wonder_city", + "player%d.adv.wonder_city", plrno); CALL_FUNC_EACH_AI(player_load, plr, loading->file, plrno); @@ -4546,7 +4546,7 @@ static void sg_save_player_main(struct savedata *saving, } players_iterate_end; secfile_insert_int(saving->file, plr->server.adv->wonder_city, - "player%d.wonder_city", plrno); + "player%d.adv.wonder_city", plrno); CALL_FUNC_EACH_AI(player_save, plr, saving->file, plrno); -- 2.35.1