Skip to content

Commit

Permalink
xrGame/GameObject.cpp: moved script clsid resetting to a later moment
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Aug 9, 2024
1 parent 8f4e86d commit d6eb6ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/xrGame/GameObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -287,7 +291,6 @@ void CGameObject::net_Destroy()

xr_delete(m_ini_file);

m_script_clsid = -1;
if (Visual() && smart_cast<IKinematics*>(Visual()))
smart_cast<IKinematics*>(Visual())->Callback(0, 0);
//
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/GameObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down

0 comments on commit d6eb6ce

Please sign in to comment.