From 8bd442751d7b9c5bac4d1f004345205a0e21b378 Mon Sep 17 00:00:00 2001 From: Asher Baker Date: Wed, 18 May 2016 09:11:04 +0100 Subject: [PATCH] Missing gamedata file shouldn't cause load failure --- extension/extension.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/extension/extension.cpp b/extension/extension.cpp index bffd0cd..b347cad 100644 --- a/extension/extension.cpp +++ b/extension/extension.cpp @@ -413,11 +413,10 @@ bool Accelerator::SDK_OnLoad(char *error, size_t maxlength, bool late) threader->MakeThread(&uploadThread); - if (!gameconfs->LoadGameConfigFile("accelerator.games", &gameconfig, error, maxlength)) { - return false; - } - - if (!gameconfig->GetMemSig("GetSpew", (void **)&GetSpew)) { + char gameconfigError[256]; + if (!gameconfs->LoadGameConfigFile("accelerator.games", &gameconfig, gameconfigError, sizeof(gameconfigError))) { + smutils->LogError(myself, "WARNING: Failed to load gamedata file, console output and command line will not be included in crash reports: %s", gameconfigError); + } else if (!gameconfig->GetMemSig("GetSpew", (void **)&GetSpew)) { smutils->LogError(myself, "WARNING: GetSpew not found in gamedata, console output will not be included in crash reports."); } else if (!GetSpew) { smutils->LogError(myself, "WARNING: Sigscan for GetSpew failed, console output will not be included in crash reports."); @@ -496,7 +495,7 @@ const char *GetCmdLine() { static int getCmdLineOffset = 0; if (getCmdLineOffset == 0) { - if (!gameconfig->GetOffset("GetCmdLine", &getCmdLineOffset)) { + if (!gameconfig || !gameconfig->GetOffset("GetCmdLine", &getCmdLineOffset)) { return ""; } if (getCmdLineOffset == 0) {