mirror of https://github.com/OpenTTD/OpenTTD
Fix 0238a2b5: crash when news message is displayed (#11195)
parent
40195e689d
commit
9dc2fbe4fa
|
@ -309,9 +309,9 @@ struct NewsWindow : Window {
|
||||||
NWidgetViewport *nvp = this->GetWidget<NWidgetViewport>(WID_N_VIEWPORT);
|
NWidgetViewport *nvp = this->GetWidget<NWidgetViewport>(WID_N_VIEWPORT);
|
||||||
if (nvp != nullptr) {
|
if (nvp != nullptr) {
|
||||||
if (ni->reftype1 == NR_VEHICLE) {
|
if (ni->reftype1 == NR_VEHICLE) {
|
||||||
nvp->InitializeViewport(this, GetReferenceTile(ni->reftype1, ni->ref1), ScaleZoomGUI(ZOOM_LVL_NEWS));
|
|
||||||
} else {
|
|
||||||
nvp->InitializeViewport(this, static_cast<VehicleID>(ni->ref1), ScaleZoomGUI(ZOOM_LVL_NEWS));
|
nvp->InitializeViewport(this, static_cast<VehicleID>(ni->ref1), ScaleZoomGUI(ZOOM_LVL_NEWS));
|
||||||
|
} else {
|
||||||
|
nvp->InitializeViewport(this, GetReferenceTile(ni->reftype1, ni->ref1), ScaleZoomGUI(ZOOM_LVL_NEWS));
|
||||||
}
|
}
|
||||||
if (this->ni->flags & NF_NO_TRANSPARENT) nvp->disp_flags |= ND_NO_TRANSPARENCY;
|
if (this->ni->flags & NF_NO_TRANSPARENT) nvp->disp_flags |= ND_NO_TRANSPARENCY;
|
||||||
if ((this->ni->flags & NF_INCOLOUR) == 0) {
|
if ((this->ni->flags & NF_INCOLOUR) == 0) {
|
||||||
|
|
Loading…
Reference in New Issue