fix(Core/Player): Force UpdateZone on resurrect to apply Zone auras (#21888)

This commit is contained in:
Jelle Meeus
2025-04-12 18:38:32 +02:00
committed by GitHub
parent d75073a941
commit 4b64c4ed25
3 changed files with 7 additions and 4 deletions

View File

@@ -4535,7 +4535,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
// trigger update zone for alive state zone updates
uint32 newzone, newarea;
GetZoneAndAreaId(newzone, newarea);
UpdateZone(newzone, newarea);
UpdateZone(newzone, newarea, true);
sOutdoorPvPMgr->HandlePlayerResurrects(this, newzone);
if (Battleground* bg = GetBattleground())

View File

@@ -1862,7 +1862,7 @@ public:
itr->SetPvP(state);
}
void UpdatePvP(bool state, bool _override = false);
void UpdateZone(uint32 newZone, uint32 newArea);
void UpdateZone(uint32 newZone, uint32 newArea, bool force = false);
void UpdateArea(uint32 newArea);
void SetNeedZoneUpdate(bool needUpdate) { m_needZoneUpdate = needUpdate; }

View File

@@ -1249,17 +1249,20 @@ void Player::UpdateArea(uint32 newArea)
RemoveRestFlag(REST_FLAG_IN_FACTION_AREA);
}
void Player::UpdateZone(uint32 newZone, uint32 newArea)
void Player::UpdateZone(uint32 newZone, uint32 newArea, bool force)
{
if (!newZone)
return;
if (m_zoneUpdateId != newZone)
if (m_zoneUpdateId != newZone || force)
{
sOutdoorPvPMgr->HandlePlayerLeaveZone(this, m_zoneUpdateId);
sOutdoorPvPMgr->HandlePlayerEnterZone(this, newZone);
sWorldState->HandlePlayerLeaveZone(this, static_cast<WorldStateZoneId>(m_zoneUpdateId));
sWorldState->HandlePlayerEnterZone(this, static_cast<WorldStateZoneId>(newZone));
}
if (m_zoneUpdateId != newZone)
{
sBattlefieldMgr->HandlePlayerLeaveZone(this, m_zoneUpdateId);
sBattlefieldMgr->HandlePlayerEnterZone(this, newZone);
SendInitWorldStates(newZone,