From 277e80abb50671e3750b65ccfe9ca925677b263e Mon Sep 17 00:00:00 2001 From: PeterN Date: Sat, 3 Jun 2023 12:07:59 +0100 Subject: [PATCH] Fix: GRF Parameters not displayed due to scope issue. (#10911) Move params so it is still in scope when the text is actually drawn. (cherry picked from commit a5a3a07005ed430426efe62bb6dbb61c691266f5) --- src/newgrf_gui.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 8b42d1ce3d..a48f4c1788 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -113,8 +113,9 @@ static void ShowNewGRFInfo(const GRFConfig *c, const Rect &r, bool show_params) /* Show GRF parameter list */ if (show_params) { + std::string params; if (c->num_params > 0) { - std::string params = GRFBuildParamList(c); + params = GRFBuildParamList(c); SetDParam(0, STR_JUST_RAW_STRING); SetDParamStr(1, params); } else {