From a5a3a07005ed430426efe62bb6dbb61c691266f5 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. --- 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 cec827f300..d9f0d63787 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -110,8 +110,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 {