diff options
Diffstat (limited to 'src/game/MiscHandler.cpp')
-rw-r--r-- | src/game/MiscHandler.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index 5cc3d6f3e35..cb1d6dca583 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -918,23 +918,8 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) return; // check if player can enter instance : instance not full, and raid instance not in encounter fight - if (Map * newMap = MapManager::Instance().CreateMap(at->target_mapId, GetPlayer(), 0)) - { - if (newMap && newMap->IsDungeon() && ((InstanceMap*)newMap)->GetInstanceData() && ((InstanceMap*)newMap)->GetMapDifficulty()) - { - if (newMap->GetPlayersCountExceptGMs() >= ((InstanceMap*)newMap)->GetMapDifficulty()->maxPlayers) - { - GetPlayer()->SendTransferAborted(at->target_mapId, TRANSFER_ABORT_MAX_PLAYERS); - return; - } - - if (newMap->IsRaid() && ((InstanceMap*)newMap)->GetInstanceData()->IsEncounterInProgress()) - { - GetPlayer()->SendTransferAborted(at->target_mapId, TRANSFER_ABORT_ZONE_IN_COMBAT); - return; - } - } - } + if (!MapManager::Instance().CanPlayerEnter(at->target_mapId, GetPlayer(), false)) + return; GetPlayer()->TeleportTo(at->target_mapId,at->target_X,at->target_Y,at->target_Z,at->target_Orientation,TELE_TO_NOT_LEAVE_TRANSPORT); } |