From 59e767fc16eee70cebee85787fba6d7ee1621ad6 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 17 Mar 2022 03:26:24 +0200 Subject: [PATCH 21/21] Legacy save: Handle player count inconsistency also in NDEBUG builds See osdn #44129 Signed-off-by: Marko Lindqvist --- server/legacysave.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/server/legacysave.c b/server/legacysave.c index c0bda8bfae..2391f5c3b7 100644 --- a/server/legacysave.c +++ b/server/legacysave.c @@ -4037,10 +4037,9 @@ static void game_load_internal(struct section_file *file) } player_slots_iterate_end; /* check number of players */ - { - int nplayers = secfile_lookup_int_default(file, 0, "game.nplayers"); - - fc_assert_ret(player_count() == nplayers); + if (secfile_lookup_int_default(file, 0, "game.nplayers") != player_count()) { + log_error(_("Inconsistent player count in savegame")); + return; /* FIXME: Should this be fatal? */ } /* Load team informations. All players should now have teams. This is -- 2.35.1