mirror of https://github.com/OpenTTD/OpenTTD
Fix: Wrong type cast for selected AI/GS script info in AIListWindow
This resulted in technically undefined behaviour when listing GSspull/10278/head
parent
d4c530904c
commit
14c1266bbc
|
@ -142,11 +142,11 @@ struct AIListWindow : public Window {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WID_AIL_INFO_BG: {
|
case WID_AIL_INFO_BG: {
|
||||||
AIInfo *selected_info = nullptr;
|
ScriptInfo *selected_info = nullptr;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (const auto &item : *this->info_list) {
|
for (const auto &item : *this->info_list) {
|
||||||
i++;
|
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. */
|
/* Some info about the currently selected AI. */
|
||||||
if (selected_info != nullptr) {
|
if (selected_info != nullptr) {
|
||||||
|
|
Loading…
Reference in New Issue