From 4f35a8bcd29397e34913da01300294ab05e3f01c Mon Sep 17 00:00:00 2001 From: Louis Moureaux Date: Mon, 22 Nov 2021 00:39:25 +0100 Subject: [PATCH] Fallback all unknown AI types to "classic" "classic" is the only AI available in fc21 anyway. It's better to load the game slightly wrong than to fail to load it because of an unsupported AI type. See #746. --- common/ai.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/common/ai.cpp b/common/ai.cpp index 68f71d34c6..05a41b1cc1 100644 --- a/common/ai.cpp +++ b/common/ai.cpp @@ -119,15 +119,10 @@ const char *ai_type_name_or_fallback(const char *orig_name) return orig_name; } - if (!strcmp("threaded", orig_name)) { - struct ai_type *fb; - - fb = ai_type_by_name("classic"); - - if (fb != NULL) { - // Get pointer to persistent name of the ai_type - return ai_name(fb); - } + auto fb = ai_type_by_name("classic"); + if (fb != nullptr) { + // Get pointer to persistent name of the ai_type + return ai_name(fb); } return NULL;