From b719dd68cdbd863ab8629611e26ad1f007434294 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 27 Mar 2022 07:04:56 +0300 Subject: [PATCH 3/3] Convert main AI level to supported one when loading savegame When loading savegame with the main AI level set to "Experimental" to a non-debug build, where such level is not supported, convert it to "Hard". We already did this for existing, individual, players. See osdn #44165 Signed-off-by: Marko Lindqvist --- server/savegame2.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/savegame2.c b/server/savegame2.c index 14e7fb719e..fdfcdea2a7 100644 --- a/server/savegame2.c +++ b/server/savegame2.c @@ -2256,6 +2256,12 @@ static void sg_load_game(struct loaddata *loading) "game.level"); if (level != NULL) { game.info.skill_level = ai_level_by_name(level, fc_strcasecmp); + + /* In builds where level "Experimental" is not supported, convert it to "Hard" */ + if (!ai_level_is_valid(game.info.skill_level) + && !fc_strcasecmp(level, "Experimental")) { + game.info.skill_level = AI_LEVEL_HARD; + } } else { game.info.skill_level = ai_level_invalid(); } -- 2.35.1