Skip to content

Commit

Permalink
Remove PvP Flag in sanctuary zones
Browse files Browse the repository at this point in the history
  • Loading branch information
Laizerox authored and Warlockbugs committed Apr 26, 2017
1 parent 0064658 commit 8721295
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/game/MiscHandler.cpp
Expand Up @@ -341,6 +341,13 @@ void WorldSession::HandleLogoutCancelOpcode(WorldPacket& /*recv_data*/)

void WorldSession::HandleTogglePvP(WorldPacket& recv_data)
{
uint32 zoneId = GetPlayer()->GetZoneId();
if (AreaTableEntry const* zone = GetAreaEntryByAreaID(zoneId))
{
if (zone->flags & AREA_FLAG_SANCTUARY)
return;
}

// this opcode can be used in two ways: Either set explicit new status or toggle old status
if (recv_data.size() == 1)
{
Expand Down
5 changes: 5 additions & 0 deletions src/game/Player.cpp
Expand Up @@ -7034,6 +7034,11 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
if (zone->flags & AREA_FLAG_SANCTUARY) // in sanctuary
{
SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_SANCTUARY);

// Sanctuary zones removes pvp flags
if (IsPvP() || pvpInfo.endTimer != 0)
UpdatePvP(false);

if (sWorld.IsFFAPvPRealm())
SetFFAPvP(false);
}
Expand Down

0 comments on commit 8721295

Please sign in to comment.