From 2ce5e498aba1cf78a3228a6e29e5a38206d12b3a Mon Sep 17 00:00:00 2001 From: smallmodel <15067410+smallmodel@users.noreply.github.com> Date: Tue, 29 Oct 2024 21:11:44 +0100 Subject: [PATCH] Use CurrentScriptThread() when getting the current script class So if the current thread is NULL, it will properly throw an exception --- code/fgame/scriptmaster.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/fgame/scriptmaster.cpp b/code/fgame/scriptmaster.cpp index 154e9d4a..67ccfcce 100644 --- a/code/fgame/scriptmaster.cpp +++ b/code/fgame/scriptmaster.cpp @@ -835,7 +835,7 @@ void ScriptMaster::RemoveTiming(ScriptThread *thread) ScriptClass *ScriptMaster::CurrentScriptClass(void) { - return CurrentThread()->GetScriptClass(); + return CurrentScriptThread()->GetScriptClass(); } void ScriptMaster::CloseGameScript(void) @@ -1099,7 +1099,6 @@ ScriptThread *ScriptMaster::CurrentThread(void) ScriptThread *ScriptMaster::CurrentScriptThread(void) { - assert(m_CurrentThread); if (!m_CurrentThread) { ScriptError("current thread is NULL"); }