mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 18:36:31 +01:00
Core/Players: reduce excessive casting of spell_area spells by casting them only when zone and area ids actually change
This commit is contained in:
@@ -7235,7 +7235,8 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
|
||||
// recent client version not send leave/join channel packets for built-in local channels
|
||||
UpdateLocalChannels(newZone);
|
||||
|
||||
UpdateZoneDependentAuras(newZone);
|
||||
if (oldZone != newZone)
|
||||
UpdateZoneDependentAuras(newZone);
|
||||
|
||||
// call enter script hooks after everyting else has processed
|
||||
sScriptMgr->OnPlayerUpdateZone(this, newZone, newArea);
|
||||
@@ -24858,6 +24859,10 @@ void Player::UpdateAreaDependentAuras(uint32 newArea)
|
||||
++iter;
|
||||
}
|
||||
|
||||
// UpdateZoneDependentAuras takes care of zone specific auras so skip excessive casting if the area Id is the same as its parent.
|
||||
if (m_zoneUpdateId == newArea)
|
||||
return;
|
||||
|
||||
// some auras applied at subzone enter
|
||||
SpellAreaForAreaMapBounds saBounds = sSpellMgr->GetSpellAreaForAreaMapBounds(newArea);
|
||||
for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
|
||||
|
||||
Reference in New Issue
Block a user