Add Outdoor PvP handlers to various files

This commit is contained in:
Xfurry 2012-08-17 18:47:59 +02:00 committed by Antz
parent 525ec3ea4c
commit e955c3bc8f
6 changed files with 68 additions and 4 deletions

View file

@ -52,6 +52,7 @@
#include "BattleGround.h"
#include "BattleGroundAV.h"
#include "BattleGroundMgr.h"
#include "OutdoorPvP/OutdoorPvP.h"
#include "ArenaTeam.h"
#include "Chat.h"
#include "Database/DatabaseImpl.h"
@ -621,6 +622,10 @@ void Player::CleanupsBeforeDelete()
TradeCancel(false);
DuelComplete(DUEL_INTERUPTED);
}
// notify zone scripts for player logout
sOutdoorPvPMgr.HandlePlayerLeaveZone(this, m_zoneUpdateId);
Unit::CleanupsBeforeDelete();
}
@ -6870,6 +6875,10 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
if (m_zoneUpdateId != newZone)
{
// handle outdoor pvp zones
sOutdoorPvPMgr.HandlePlayerLeaveZone(this, m_zoneUpdateId);
sOutdoorPvPMgr.HandlePlayerEnterZone(this, newZone);
SendInitWorldStates(newZone, newArea); // only if really enters to new zone, not just area change, works strange...
if (sWorld.getConfig(CONFIG_BOOL_WEATHER))