From ae123ed2d21eff3054bbf28f6c168dbdbe6186bd Mon Sep 17 00:00:00 2001 From: AllMeatball <181806857+AllMeatball@users.noreply.github.com> Date: Fri, 16 May 2025 15:00:33 -0500 Subject: [PATCH] isleapp: Better error logs & return false in places foxtacles recommended to use SDL's logging api to show detailed errors and using false in two places where it should exit because of failure. This commit adds these two things. --- ISLE/isleapp.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ISLE/isleapp.cpp b/ISLE/isleapp.cpp index c33c1e50..4fbdc2b5 100644 --- a/ISLE/isleapp.cpp +++ b/ISLE/isleapp.cpp @@ -743,6 +743,7 @@ inline bool IsleApp::Tick() if (!stream) { stream = Streamer()->Open("\\lego\\scripts\\nocd", MxStreamer::e_diskStream); if (!stream) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to open NOCD.si: Streamer failed to load"); SDL_ShowSimpleMessageBox( SDL_MESSAGEBOX_ERROR, "LEGO® Island Error", @@ -759,7 +760,15 @@ inline bool IsleApp::Tick() VideoManager()->EnableFullScreenMovie(TRUE, TRUE); if (Start(&ds) != SUCCESS) { - return true; + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to open NOCD.si: Failed to start initial action"); + SDL_ShowSimpleMessageBox( + SDL_MESSAGEBOX_ERROR, + "LEGO® Island Error", + "\"LEGO® Island\" failed to start.\nPlease quit all other applications and try again." + "\nFailed to load NOCD.si", + NULL + ); + return false; } } else { @@ -767,7 +776,8 @@ inline bool IsleApp::Tick() ds.SetUnknown24(-1); ds.SetObjectId(0); if (Start(&ds) != SUCCESS) { - return true; + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to open ISLE.si: Failed to start initial action"); + return false; } m_gameStarted = TRUE; }