From a4c77d09c769eff2a7d3d3c3d3bbf6a30bc4ec9f Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 8 Jul 2026 20:31:56 +0200 Subject: [PATCH] have fallback if SDL_OpenURL fails or does not exist on the Errorbox --- src/i_system.h | 3 +++ src/sdl/i_system.cpp | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/i_system.h b/src/i_system.h index 7f97557be..881a5f2f4 100644 --- a/src/i_system.h +++ b/src/i_system.h @@ -14,6 +14,9 @@ #ifndef __I_SYSTEM__ #define __I_SYSTEM__ +// page for Saturn issue reports +#define SATURNISSUEPAGE "https://github.com/Indev450/SRB2Kart-Saturn/issues" + #ifdef __cplusplus extern "C" { #endif diff --git a/src/sdl/i_system.cpp b/src/sdl/i_system.cpp index 11948130c..b19bf2a6b 100644 --- a/src/sdl/i_system.cpp +++ b/src/sdl/i_system.cpp @@ -1717,6 +1717,8 @@ static int I_OpenURL(const char *url) static void I_ShowErrorBox(const char *title, const char *msg) { + int url = -1; + if (M_CheckParm("-dedicated")) return; @@ -1742,7 +1744,11 @@ static void I_ShowErrorBox(const char *title, const char *msg) SDL_ShowMessageBox(&messageboxdata, &buttonid); if (buttonid == 1) - I_OpenURL("https://github.com/Indev450/SRB2Kart-Saturn/issues"); + url = I_OpenURL(SATURNISSUEPAGE); + + // SDL_OpenURL unsupported or failed + if (url == -1) + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Failed to Open Web Page", "Please open the following page in your web browser:\n" SATURNISSUEPAGE, NULL); } static void I_ShowSimpleErrorBox(const char *title, char *msg)