Use CurrentScriptThread() when getting the current script class

So if the current thread is NULL, it will properly throw an exception
This commit is contained in:
smallmodel 2024-10-29 21:11:44 +01:00 committed by GitHub
parent d3212c55a0
commit 2ce5e498ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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");
}