summaryrefslogtreecommitdiff
path: root/src/script/cpp_api
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/cpp_api')
-rw-r--r--src/script/cpp_api/s_base.cpp7
-rw-r--r--src/script/cpp_api/s_security.cpp1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/script/cpp_api/s_base.cpp b/src/script/cpp_api/s_base.cpp
index e73f613ce..caa335d76 100644
--- a/src/script/cpp_api/s_base.cpp
+++ b/src/script/cpp_api/s_base.cpp
@@ -232,6 +232,13 @@ void ScriptApiBase::loadModFromMemory(const std::string &mod_name)
void ScriptApiBase::runCallbacksRaw(int nargs,
RunCallbacksMode mode, const char *fxn)
{
+#ifndef SERVER
+ // Hard fail for bad guarded callbacks
+ // Only run callbacks when the scripting enviroment is loaded
+ FATAL_ERROR_IF(m_type == ScriptingType::Client &&
+ !getClient()->modsLoaded(), fxn);
+#endif
+
#ifdef SCRIPTAPI_LOCK_DEBUG
assert(m_lock_recursion_count > 0);
#endif
diff --git a/src/script/cpp_api/s_security.cpp b/src/script/cpp_api/s_security.cpp
index 876c7761a..d972be980 100644
--- a/src/script/cpp_api/s_security.cpp
+++ b/src/script/cpp_api/s_security.cpp
@@ -264,6 +264,7 @@ void ScriptApiSecurity::initializeSecurityClient()
};
static const char *debug_whitelist[] = {
"getinfo",
+ "traceback"
};
#if USE_LUAJIT