diff --git a/src/game/CSector.cpp b/src/game/CSector.cpp index 866ed24e3..855d59af9 100644 --- a/src/game/CSector.cpp +++ b/src/game/CSector.cpp @@ -180,7 +180,8 @@ void CSector::_GoSleep() for (CSObjContRec* pObjRec : m_Chars_Active) { CChar* pChar = static_cast(pObjRec); - const bool fCanTick = pChar->CanTick(true); + //call objbase CanTick to check if it can sleep + const bool fCanTick = static_cast(pChar)->CanTick(true); ASSERT(!pChar->IsDisconnected()); if (!fCanTick) pChar->GoSleep(); @@ -189,7 +190,7 @@ void CSector::_GoSleep() for (CSObjContRec* pObjRec : m_Chars_Disconnect) { CChar* pChar = static_cast(pObjRec); - const bool fCanTick = pChar->CanTick(true); + const bool fCanTick = static_cast(pChar)->CanTick(true); ASSERT(pChar->IsDisconnected()); if (!fCanTick) pChar->GoSleep(); @@ -198,7 +199,7 @@ void CSector::_GoSleep() for (CSObjContRec* pObjRec : m_Items) { CItem* pItem = static_cast(pObjRec); - const bool fCanTick = pItem->CanTick(true); + const bool fCanTick = static_cast(pItem)->CanTick(true); if (!fCanTick) pItem->GoSleep(); }