forked from mirror/OpenTTD
Orders window has different widget layouts depending on vehicle type which don't all have the same widgets, and therefore it tries to disable widgets that might not exist. Restore the old behaviour of ignoring such requests, instead of crashing.
This commit is contained in:
@@ -327,7 +327,8 @@ public:
|
|||||||
*/
|
*/
|
||||||
inline void SetWidgetDisabledState(WidgetID widget_index, bool disab_stat)
|
inline void SetWidgetDisabledState(WidgetID widget_index, bool disab_stat)
|
||||||
{
|
{
|
||||||
this->GetWidget<NWidgetCore>(widget_index)->SetDisabled(disab_stat);
|
NWidgetCore *nwid = this->GetWidget<NWidgetCore>(widget_index);
|
||||||
|
if (nwid != nullptr) nwid->SetDisabled(disab_stat);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user