File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -533,16 +533,17 @@ int MovableObject::Save(Writer &writer) const
533
533
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
534
534
535
535
void MovableObject::DestroyScriptState () {
536
- if (ObjectScriptsInitialized () ) {
537
- RunScriptedFunctionInAppropriateScripts ( " Destroy " );
538
-
539
- if (m_ThreadedLuaState ) {
540
- std::lock_guard<std::recursive_mutex> lock (m_ThreadedLuaState-> GetMutex () );
536
+ if (m_ThreadedLuaState ) {
537
+ std::lock_guard<std::recursive_mutex> lock (m_ThreadedLuaState-> GetMutex () );
538
+
539
+ if (ObjectScriptsInitialized () ) {
540
+ RunScriptedFunctionInAppropriateScripts ( " Destroy " );
541
541
m_ThreadedLuaState->RunScriptString (m_ScriptObjectName + " = nil;" );
542
- m_ThreadedLuaState->UnregisterMO (this );
543
- m_ThreadedLuaState = nullptr ;
544
542
m_ScriptObjectName.clear ();
545
543
}
544
+
545
+ m_ThreadedLuaState->UnregisterMO (this );
546
+ m_ThreadedLuaState = nullptr ;
546
547
}
547
548
}
548
549
You can’t perform that action at this time.
0 commit comments