mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 18:10:26 +00:00
fix(Core/Maps): Move corpse expiration updates to map (#22780)
This commit is contained in:
@@ -73,6 +73,8 @@ Map::Map(uint32 id, uint32 InstanceId, uint8 SpawnMode, Map* _parent) :
|
||||
|
||||
//lets initialize visibility distance for map
|
||||
Map::InitVisibilityDistance();
|
||||
|
||||
_corpseUpdateTimer.SetInterval(20 * MINUTE * IN_MILLISECONDS);
|
||||
}
|
||||
|
||||
// Hook called after map is created AND after added to map list
|
||||
@@ -494,6 +496,8 @@ void Map::Update(const uint32 t_diff, const uint32 s_diff, bool /*thread*/)
|
||||
|
||||
HandleDelayedVisibility();
|
||||
|
||||
UpdateExpiredCorpses(t_diff);
|
||||
|
||||
sScriptMgr->OnMapUpdate(this, t_diff);
|
||||
|
||||
METRIC_VALUE("map_creatures", uint64(GetObjectsStore().Size<Creature>()),
|
||||
@@ -1580,6 +1584,17 @@ void Map::SendInitSelf(Player* player)
|
||||
player->SendDirectMessage(&packet);
|
||||
}
|
||||
|
||||
void Map::UpdateExpiredCorpses(uint32 const diff)
|
||||
{
|
||||
_corpseUpdateTimer.Update(diff);
|
||||
if (!_corpseUpdateTimer.Passed())
|
||||
return;
|
||||
|
||||
RemoveOldCorpses();
|
||||
|
||||
_corpseUpdateTimer.Reset();
|
||||
}
|
||||
|
||||
void Map::SendInitTransports(Player* player)
|
||||
{
|
||||
if (_transports.empty())
|
||||
|
||||
Reference in New Issue
Block a user