From b257e0b6624734097b64df387c50c82a059b7201 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 17 Mar 2022 03:28:18 +0200 Subject: [PATCH 6/6] Legacy save: Handle player count inconsistency also in NDEBUG builds See osdn #44129 Signed-off-by: Marko Lindqvist --- server/savegame.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/server/savegame.c b/server/savegame.c index 7f1e5cc60c..4bc69c8d35 100644 --- a/server/savegame.c +++ b/server/savegame.c @@ -4000,10 +4000,8 @@ 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()) { + return; /* FIXME: Should this be fatal? */ } /* Load team informations. All players should now have teams. This is -- 2.35.1