aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/scripts/scriptjson.cpp
diff options
context:
space:
mode:
authorEladNLG <e1lad8955@gmail.com>2023-04-19 02:28:07 +0300
committerGitHub <noreply@github.com>2023-04-18 19:28:07 -0400
commit4e341f156b05fafbaed9584bff8aecd2f2d54f15 (patch)
tree6126bf2cb21aedec7b6778de960f15451a7b1c5d /NorthstarDLL/scripts/scriptjson.cpp
parentca45fcc4c541e90fbcd5dc9a3dc0abf06af54dbc (diff)
downloadNorthstarLauncher-4e341f156b05fafbaed9584bff8aecd2f2d54f15.tar.gz
NorthstarLauncher-4e341f156b05fafbaed9584bff8aecd2f2d54f15.zip
Fix DecodeJSON fatalParseErrors param (#443)
Previously, DecodeJSON would log a warning and swallow the error silently, even if the second argument (fatalParseErrors) was true (default is false).
Diffstat (limited to 'NorthstarDLL/scripts/scriptjson.cpp')
-rw-r--r--NorthstarDLL/scripts/scriptjson.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/NorthstarDLL/scripts/scriptjson.cpp b/NorthstarDLL/scripts/scriptjson.cpp
index 98cb52d6..06bda6f4 100644
--- a/NorthstarDLL/scripts/scriptjson.cpp
+++ b/NorthstarDLL/scripts/scriptjson.cpp
@@ -212,10 +212,12 @@ ADD_SQFUNC(
doc.GetErrorOffset());
if (bFatalParseErrors)
+ {
g_pSquirrel<context>->raiseerror(sqvm, sErrorString.c_str());
- else
- spdlog::warn(sErrorString);
+ return SQRESULT_ERROR;
+ }
+ spdlog::warn(sErrorString);
return SQRESULT_NOTNULL;
}