From 14c1266bbc189521c8c7a5da19e57e4e94268ed3 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Thu, 22 Dec 2022 19:25:47 +0000 Subject: [PATCH] Fix: Wrong type cast for selected AI/GS script info in AIListWindow This resulted in technically undefined behaviour when listing GSs --- src/ai/ai_gui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 041b9b6f10..d885de813b 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -142,11 +142,11 @@ struct AIListWindow : public Window { break; } case WID_AIL_INFO_BG: { - AIInfo *selected_info = nullptr; + ScriptInfo *selected_info = nullptr; int i = 0; for (const auto &item : *this->info_list) { i++; - if (this->selected == i - 1) selected_info = static_cast(item.second); + if (this->selected == i - 1) selected_info = static_cast(item.second); } /* Some info about the currently selected AI. */ if (selected_info != nullptr) {