From 4547dfab950138198090918d7141989f29c7be21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 12 Jun 2017 11:52:04 +0200 Subject: [PATCH] Prevent a crash in headless mode when showing error --- src/openrct2/windows/error.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/openrct2/windows/error.c b/src/openrct2/windows/error.c index ec86880460..82e637884a 100644 --- a/src/openrct2/windows/error.c +++ b/src/openrct2/windows/error.c @@ -103,6 +103,11 @@ void window_error_open(rct_string_id title, rct_string_id message) log_verbose("show error, %s", _window_error_text + 1); + // Don't do unnecessary work in headless. Also saves checking if cursor state is null. + if (gOpenRCT2Headless) { + return; + } + // Check if there is any text to display if (dst == _window_error_text + 1) return;