void CSector::GoSleep() { ADDTOCALLSTACK("CSector::Sleep"); ProfileTask charactersTask(PROFILE_TIMERS); CTimedObject::GoSleep(); CChar * pCharNext = nullptr; CChar * pChar = static_cast <CChar*>(m_Chars_Active.GetHead()); for (; pChar != nullptr; pChar = pCharNext) { pCharNext = pChar->GetNext(); if (!pChar->IsSleeping()) pChar->GoSleep(); } CItem * pItemNext = nullptr; CItem * pItem = static_cast <CItem*>(m_Items_Timer.GetHead()); for (; pItem != nullptr; pItem = pItemNext) { pItemNext = pItem->GetNext(); if (!pItem->IsSleeping()) pItem->GoSleep(); } pItemNext = nullptr; pItem = static_cast <CItem*>(m_Items_Inert.GetHead()); for (; pItem != nullptr; pItem = pItemNext) { pItemNext = pItem->GetNext(); if (!pItem->IsSleeping()) pItem->GoSleep(); } }