From 0b9c54f9875850681e9402ea91ce50f01d2f1e62 Mon Sep 17 00:00:00 2001 From: SamuXarick <43006711+SamuXarick@users.noreply.github.com> Date: Thu, 1 Feb 2024 15:42:55 +0000 Subject: [PATCH] Fix: Restore Random AI slot upon stopping a randomly started AI --- src/ai/ai_core.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ai/ai_core.cpp b/src/ai/ai_core.cpp index ac60b78ad9..95ed701121 100644 --- a/src/ai/ai_core.cpp +++ b/src/ai/ai_core.cpp @@ -115,6 +115,10 @@ cur_company.Restore(); InvalidateWindowClassesData(WC_SCRIPT_DEBUG, -1); + + if (AIConfig::GetConfig(company)->IsRandom()) { + AIConfig::GetConfig(company)->Change(std::nullopt); + } CloseWindowById(WC_SCRIPT_SETTINGS, company); }