From de4c1edf9b062e10f5cde11cfa12a073452c2b69 Mon Sep 17 00:00:00 2001 From: Schmoozerd Date: Fri, 31 May 2013 10:46:04 +0100 Subject: [PATCH] [c12590] Do more checks if a Player can enter a map On Login --- src/game/CharacterHandler.cpp | 10 ++++++---- src/shared/revision_nr.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp index b09cd3cf5..addfa2a55 100644 --- a/src/game/CharacterHandler.cpp +++ b/src/game/CharacterHandler.cpp @@ -722,13 +722,15 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder *holder) } } - if (!pCurrChar->GetMap()->Add(pCurrChar)) + uint32 miscRequirement = 0; + AreaLockStatus lockStatus = pCurrChar->GetAreaTriggerLockStatus(sObjectMgr.GetMapEntranceTrigger(pCurrChar->GetMapId()), pCurrChar->GetDifficulty(pCurrChar->GetMap()->IsRaid()), miscRequirement); + if (lockStatus != AREA_LOCKSTATUS_OK || !pCurrChar->GetMap()->Add(pCurrChar)) { // normal delayed teleport protection not applied (and this correct) for this case (Player object just created) AreaTrigger const* at = sObjectMgr.GetGoBackTrigger(pCurrChar->GetMapId()); - if(at) - pCurrChar->TeleportTo(at->target_mapId, at->target_X, at->target_Y, at->target_Z, pCurrChar->GetOrientation()); - else + if (at) + lockStatus = pCurrChar->GetAreaTriggerLockStatus(at, pCurrChar->GetDifficulty(pCurrChar->GetMap()->IsRaid()), miscRequirement); + if (!at || lockStatus != AREA_LOCKSTATUS_OK || !pCurrChar->TeleportTo(at->target_mapId, at->target_X, at->target_Y, at->target_Z, pCurrChar->GetOrientation())) pCurrChar->TeleportToHomebind(); } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index ea5de9b63..94d681608 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 "12589" + #define REVISION_NR "12590" #endif // __REVISION_NR_H__