mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix #5522: Clicking Player Name field results in crash
This commit is contained in:
parent
ab8e8952e0
commit
bf16951341
|
@ -1080,7 +1080,7 @@ static void widget_text_box_draw(rct_drawpixelinfo *dpi, rct_window *w, rct_widg
|
|||
gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM;
|
||||
gCurrentFontFlags = 0;
|
||||
|
||||
if (!active) {
|
||||
if (!active || gTextInput == NULL) {
|
||||
|
||||
if (w->widgets[widgetIndex].text != 0) {
|
||||
safe_strcpy(wrapped_string, w->widgets[widgetIndex].string, 512);
|
||||
|
|
|
@ -2513,7 +2513,7 @@ void window_start_textbox(rct_window *call_w, rct_widgetindex call_widget, rct_s
|
|||
// from crashing the game.
|
||||
gTextBoxInput[maxLength - 1] = '\0';
|
||||
|
||||
context_start_text_input(gTextBoxInput, maxLength);
|
||||
gTextInput = context_start_text_input(gTextBoxInput, maxLength);
|
||||
}
|
||||
|
||||
void window_cancel_textbox()
|
||||
|
|
Loading…
Reference in New Issue