diff options
Diffstat (limited to 'src/misc_gui.cpp')
-rw-r--r-- | src/misc_gui.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 64bb1e9f1..e3b644927 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -9,6 +9,7 @@ #include "functions.h" #include "landscape.h" #include "newgrf.h" +#include "newgrf_text.h" #include "saveload.h" #include "strings.h" #include "table/sprites.h" @@ -505,6 +506,13 @@ static void ErrmsgWndProc(Window *w, WindowEvent *e) CopyInDParam(0, _errmsg_decode_params, lengthof(_errmsg_decode_params)); DrawWindowWidgets(w); CopyInDParam(0, _errmsg_decode_params, lengthof(_errmsg_decode_params)); + + /* If the error message comes from a NewGRF, we must use the text ref. stack reserved for error messages. + * If the message doesn't come from a NewGRF, it won't use the TTDP-style text ref. stack, so we won't hurt anything + */ + SwitchToErrorRefStack(); + RewindTextRefStack(); + if (!IsWindowOfPrototype(w, _errmsg_face_widgets)) { DrawStringMultiCenter( 120, @@ -533,6 +541,9 @@ static void ErrmsgWndProc(Window *w, WindowEvent *e) _errmsg_message_1, w->width - 2); } + + /* Switch back to the normal text ref. stack for NewGRF texts */ + SwitchToNormalRefStack(); break; case WE_MOUSELOOP: |