diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index d839e58850..5323251363 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -169,8 +169,11 @@ struct AIConfigWindow : public Window { std::string GetSlotText(CompanyID cid) const { if ((_game_mode != GM_NORMAL && cid == 0) || (_game_mode == GM_NORMAL && Company::IsValidHumanID(cid))) return GetString(STR_AI_CONFIG_HUMAN_PLAYER); - if (const AIInfo *info = AIConfig::GetConfig(cid)->GetInfo(); info != nullptr) return info->GetName(); - return GetString(STR_AI_CONFIG_RANDOM_AI); + const AIConfig *config = AIConfig::GetConfig(cid); + const AIInfo *info = config->GetInfo(); + if (info == nullptr) return GetString(STR_AI_CONFIG_RANDOM_AI); + if (config->GetForceExactMatch()) return GetString(STR_AI_CONFIG_NAME_VERSION, info->GetName(), info->GetVersion()); + return info->GetName(); } /** diff --git a/src/game/game_gui.cpp b/src/game/game_gui.cpp index 207a4c7daf..8604a08dbc 100644 --- a/src/game/game_gui.cpp +++ b/src/game/game_gui.cpp @@ -167,8 +167,11 @@ struct GSConfigWindow : public Window { */ std::string GetText() const { - if (const GameInfo *info = GameConfig::GetConfig()->GetInfo(); info != nullptr) return info->GetName(); - return GetString(STR_AI_CONFIG_NONE); + const GameConfig *config = GameConfig::GetConfig(); + const GameInfo *info = config->GetInfo(); + if (info == nullptr) return GetString(STR_AI_CONFIG_NONE); + if (config->GetForceExactMatch()) return GetString(STR_AI_CONFIG_NAME_VERSION, info->GetName(), info->GetVersion()); + return info->GetName(); } void DrawWidget(const Rect &r, WidgetID widget) const override