From 39acbddf696b6bef881da68c2b9f6d6ba1485b4c Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 13 Mar 2011 21:47:42 +0100 Subject: Core/Players: Sanctuary status is now updated on area change, fixes argent tournament and frozen halls sanctuaries --- src/server/game/Entities/Player/Player.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 1b615f2f3d9..7e9263b641c 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7324,6 +7324,17 @@ void Player::UpdateArea(uint32 newArea) UpdatePvPState(true); UpdateAreaDependentAuras(newArea); + + // previously this was in UpdateZone (but after UpdateArea) so nothing will break + pvpInfo.inNoPvPArea = false; + if (area && area->IsSanctuary()) // in sanctuary + { + SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY); + pvpInfo.inNoPvPArea = true; + CombatStopWithPets(); + } + else + RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY); } void Player::UpdateZone(uint32 newZone, uint32 newArea) @@ -7379,16 +7390,6 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) break; } - pvpInfo.inNoPvPArea = false; - if (zone->IsSanctuary()) // in sanctuary - { - SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY); - pvpInfo.inNoPvPArea = true; - CombatStopWithPets(); - } - else - RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY); - if (zone->flags & AREA_FLAG_CAPITAL) // in capital city { if (!pvpInfo.inHostileArea || zone->IsSanctuary()) -- cgit v1.2.3