diff --git a/src/xrGame/GameObject.cpp b/src/xrGame/GameObject.cpp index 88434e7c69c..ee438186e98 100644 --- a/src/xrGame/GameObject.cpp +++ b/src/xrGame/GameObject.cpp @@ -273,7 +273,11 @@ void CGameObject::reinit() it->second.clear(); } -void CGameObject::reload(LPCSTR section) { m_script_clsid = object_factory().script_clsid(CLS_ID); } +void CGameObject::reload(LPCSTR section) +{ + m_script_clsid = object_factory().script_clsid(CLS_ID); +} + void CGameObject::net_Destroy() { #ifdef DEBUG @@ -287,7 +291,6 @@ void CGameObject::net_Destroy() xr_delete(m_ini_file); - m_script_clsid = -1; if (Visual() && smart_cast(Visual())) smart_cast(Visual())->Callback(0, 0); // @@ -325,6 +328,7 @@ void CGameObject::net_Destroy() //. Parent = 0; scriptBinder.net_Destroy(); + m_script_clsid = -1; xr_delete(m_lua_game_object); m_spawned = false; diff --git a/src/xrGame/GameObject.h b/src/xrGame/GameObject.h index 8a620e23ae6..d22ad1a801b 100644 --- a/src/xrGame/GameObject.h +++ b/src/xrGame/GameObject.h @@ -320,7 +320,7 @@ class CGameObject : public IGameObject, virtual CScriptGameObject* lua_game_object() const override; virtual int clsid() const override { - THROW(m_script_clsid >= 0); + VERIFY(m_script_clsid >= 0); return m_script_clsid; } virtual CInifile* spawn_ini() override { return m_ini_file; }