mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-28 08:06:23 +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())
|
||||
|
||||
@@ -443,6 +443,8 @@ public:
|
||||
void SendZoneDynamicInfo(Player* player);
|
||||
void SendInitSelf(Player* player);
|
||||
|
||||
void UpdateExpiredCorpses(uint32 const diff);
|
||||
|
||||
void PlayDirectSoundToMap(uint32 soundId, uint32 zoneId = 0);
|
||||
void SetZoneMusic(uint32 zoneId, uint32 musicId);
|
||||
void SetZoneWeather(uint32 zoneId, WeatherState weatherId, float weatherGrade);
|
||||
@@ -576,6 +578,8 @@ private:
|
||||
ZoneDynamicInfoMap _zoneDynamicInfo;
|
||||
uint32 _defaultLight;
|
||||
|
||||
IntervalTimer _corpseUpdateTimer;
|
||||
|
||||
template<HighGuid high>
|
||||
inline ObjectGuidGeneratorBase& GetGuidSequenceGenerator()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user