mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[9650] Some corpse related clean ups.
Old bones remove code anyway was dead, so remove it. Signed-off-by: hunuza <hunuza@gmail.com>
This commit is contained in:
parent
8b87c7ec97
commit
6750ce9185
19 changed files with 34 additions and 207 deletions
|
|
@ -258,6 +258,22 @@ ObjectAccessor::ConvertCorpseForPlayer(ObjectGuid player_guid, bool insignia)
|
|||
return bones;
|
||||
}
|
||||
|
||||
void ObjectAccessor::RemoveOldCorpses()
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
Player2CorpsesMapType::iterator next;
|
||||
for(Player2CorpsesMapType::iterator itr = i_player2corpse.begin(); itr != i_player2corpse.end(); itr = next)
|
||||
{
|
||||
next = itr;
|
||||
++next;
|
||||
|
||||
if(!itr->second->IsExpired(now))
|
||||
continue;
|
||||
|
||||
ConvertCorpseForPlayer(itr->first);
|
||||
}
|
||||
}
|
||||
|
||||
/// Define the static member of HashMapHolder
|
||||
|
||||
template <class T> UNORDERED_MAP< uint64, T* > HashMapHolder<T>::m_objectMap;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue