Skip to content

Commit

Permalink
use CanTick of CObjBase when World Load
Browse files Browse the repository at this point in the history
  • Loading branch information
raydienull authored Dec 12, 2023
1 parent 81b8d3b commit 6412dbc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/game/CSector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ void CSector::_GoSleep()
for (CSObjContRec* pObjRec : m_Chars_Active)
{
CChar* pChar = static_cast<CChar*>(pObjRec);
const bool fCanTick = pChar->CanTick(true);
//call objbase CanTick to check if it can sleep
const bool fCanTick = static_cast<CObjBase*>(pChar)->CanTick(true);
ASSERT(!pChar->IsDisconnected());
if (!fCanTick)
pChar->GoSleep();
Expand All @@ -189,7 +190,7 @@ void CSector::_GoSleep()
for (CSObjContRec* pObjRec : m_Chars_Disconnect)
{
CChar* pChar = static_cast<CChar*>(pObjRec);
const bool fCanTick = pChar->CanTick(true);
const bool fCanTick = static_cast<CObjBase*>(pChar)->CanTick(true);
ASSERT(pChar->IsDisconnected());
if (!fCanTick)
pChar->GoSleep();
Expand All @@ -198,7 +199,7 @@ void CSector::_GoSleep()
for (CSObjContRec* pObjRec : m_Items)
{
CItem* pItem = static_cast<CItem*>(pObjRec);
const bool fCanTick = pItem->CanTick(true);
const bool fCanTick = static_cast<CObjBase*>(pItem)->CanTick(true);
if (!fCanTick)
pItem->GoSleep();
}
Expand Down

0 comments on commit 6412dbc

Please sign in to comment.