From 9dc2fbe4fa5c0e8764cfc8c72e1abc4d90252922 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sun, 13 Aug 2023 12:16:36 +0200 Subject: [PATCH] Fix 0238a2b5: crash when news message is displayed (#11195) --- src/news_gui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/news_gui.cpp b/src/news_gui.cpp index f6ffc7e683..765983c47a 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -309,9 +309,9 @@ struct NewsWindow : Window { NWidgetViewport *nvp = this->GetWidget(WID_N_VIEWPORT); if (nvp != nullptr) { if (ni->reftype1 == NR_VEHICLE) { - nvp->InitializeViewport(this, GetReferenceTile(ni->reftype1, ni->ref1), ScaleZoomGUI(ZOOM_LVL_NEWS)); - } else { nvp->InitializeViewport(this, static_cast(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_INCOLOUR) == 0) {