diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 2063b68e7..b275cd77b 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -752,16 +752,16 @@ bool Creature::Create(uint32 guidlow, CreatureCreatePos& cPos, CreatureInfo cons if (!cPos.Relocate(this)) return false; + // Notify the outdoor pvp script + if (OutdoorPvP* outdoorPvP = sOutdoorPvPMgr.GetScript(GetZoneId())) + outdoorPvP->HandleCreatureCreate(this); + // Notify the map's instance data. // Only works if you create the object in it, not if it is moves to that map. // Normally non-players do not teleport to other maps. if (InstanceData* iData = GetMap()->GetInstanceData()) iData->OnCreatureCreate(this); - // Notify the outdoor pvp script - if (OutdoorPvP* outdoorPvP = sOutdoorPvPMgr.GetScript(GetZoneId())) - outdoorPvP->HandleCreatureCreate(this); - switch (GetCreatureInfo()->rank) { case CREATURE_ELITE_RARE: diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index c27e819fb..97dc67753 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -166,16 +166,16 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa if (goinfo->type == GAMEOBJECT_TYPE_CAPTURE_POINT && goinfo->capturePoint.radius) SetCapturePointSlider(sOutdoorPvPMgr.GetCapturePointSliderValue(goinfo->id)); + // Notify the outdoor pvp script + if (OutdoorPvP* outdoorPvP = sOutdoorPvPMgr.GetScript(GetZoneId())) + outdoorPvP->HandleGameObjectCreate(this); + // Notify the map's instance data. // Only works if you create the object in it, not if it is moves to that map. // Normally non-players do not teleport to other maps. if (InstanceData* iData = map->GetInstanceData()) iData->OnObjectCreate(this); - // Notify the outdoor pvp script - if (OutdoorPvP* outdoorPvP = sOutdoorPvPMgr.GetScript(GetZoneId())) - outdoorPvP->HandleGameObjectCreate(this); - return true; } @@ -344,9 +344,8 @@ void GameObject::Update(uint32 update_diff, uint32 p_time) if (IsBattleGroundTrap && ok->GetTypeId() == TYPEID_PLAYER) { // BattleGround gameobjects case - if (((Player*)ok)->InBattleGround()) - if (BattleGround* bg = ((Player*)ok)->GetBattleGround()) - bg->HandleTriggerBuff(GetObjectGuid()); + if (BattleGround* bg = ((Player*)ok)->GetBattleGround()) + bg->HandleTriggerBuff(GetObjectGuid()); } } } diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index 57c407c01..687fcd2b4 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -735,14 +735,12 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data) return; } - if (pl->InBattleGround()) + if (BattleGround* bg = pl->GetBattleGround()) { - if (BattleGround* bg = pl->GetBattleGround()) - bg->HandleAreaTrigger(pl, Trigger_ID); + bg->HandleAreaTrigger(pl, Trigger_ID); return; } - - if (OutdoorPvP* outdoorPvP = sOutdoorPvPMgr.GetScript(pl->GetCachedZoneId())) + else if (OutdoorPvP* outdoorPvP = sOutdoorPvPMgr.GetScript(pl->GetCachedZoneId())) { if (outdoorPvP->HandleAreaTrigger(pl, Trigger_ID)) return; diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index 76c059541..886e65c02 100644 --- a/src/game/MovementHandler.cpp +++ b/src/game/MovementHandler.cpp @@ -566,8 +566,7 @@ void WorldSession::HandleMoverRelocation(MovementInfo& movementInfo) if (movementInfo.GetPos()->z < -500.0f) { - if (plMover->InBattleGround() - && plMover->GetBattleGround() + if (plMover->GetBattleGround() && plMover->GetBattleGround()->HandlePlayerUnderMap(_player)) { // do nothing, the handle already did if returned true diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index ba3728dff..c1f194d8b 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "12152" + #define REVISION_NR "12153" #endif // __REVISION_NR_H__