mirror of https://github.com/OpenTTD/OpenTTD.git
Fix: Wrong type cast for selected AI/GS script info in AIListWindow
This resulted in technically undefined behaviour when listing GSs
This commit is contained in:
parent
d4c530904c
commit
14c1266bbc
|
@ -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<AIInfo *>(item.second);
|
||||
if (this->selected == i - 1) selected_info = static_cast<ScriptInfo *>(item.second);
|
||||
}
|
||||
/* Some info about the currently selected AI. */
|
||||
if (selected_info != nullptr) {
|
||||
|
|
Loading…
Reference in New Issue