Prevent players from gaining rest state in hostile capital zones.

Fix a bug where PvP status never resets when not moving to another zone.
Reset PvP status at Taxi node end/worldport when moving into friendly territory.

--HG--
branch : trunk
This commit is contained in:
thenecromancer
2010-07-31 13:55:23 +02:00
parent bdf20fa420
commit 270367abfc
2 changed files with 14 additions and 7 deletions
@@ -179,6 +179,9 @@ void WorldSession::HandleMoveWorldportAckOpcode()
// honorless target
if (GetPlayer()->pvpInfo.inHostileArea)
GetPlayer()->CastSpell(GetPlayer(), 2479, true);
// in friendly area
else if (GetPlayer()->IsPvP() && !GetPlayer()->HasFlag(PLAYER_FLAGS,PLAYER_FLAGS_IN_PVP))
GetPlayer()->UpdatePvP(false, false);
// resummon pet
GetPlayer()->ResummonPetTemporaryUnSummonedIfAny();
@@ -227,6 +230,9 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data)
// honorless target
if (plMover->pvpInfo.inHostileArea)
plMover->CastSpell(plMover, 2479, true);
// in friendly area
else if (plMover->IsPvP() && !plMover->HasFlag(PLAYER_FLAGS,PLAYER_FLAGS_IN_PVP))
plMover->UpdatePvP(false, false);
}
// resummon pet