aboutsummaryrefslogtreecommitdiff
path: root/src/game/MapManager.cpp
diff options
context:
space:
mode:
authortartalo <none@none>2009-10-22 01:54:14 +0200
committertartalo <none@none>2009-10-22 01:54:14 +0200
commit46c411b778d0a5d478f41352ce50a4bd430b67ff (patch)
treebd31621418099c3b5eb79c7cf139a5fcbc7e842d /src/game/MapManager.cpp
parent2d713bbc70f964b86ead727d0fb523bc8fc899d4 (diff)
Backed out changeset 09d9acdcaed4
Sorry for the inconvenience. Part of this push was an untested patch that was miss pushed --HG-- branch : trunk
Diffstat (limited to 'src/game/MapManager.cpp')
-rw-r--r--src/game/MapManager.cpp39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/game/MapManager.cpp b/src/game/MapManager.cpp
index 6ff38ea9c21..55d20c3f762 100644
--- a/src/game/MapManager.cpp
+++ b/src/game/MapManager.cpp
@@ -30,7 +30,6 @@
#include "Transports.h"
#include "GridDefines.h"
#include "MapInstanced.h"
-#include "InstanceData.h"
#include "DestinationHolderImp.h"
#include "World.h"
#include "CellImpl.h"
@@ -230,48 +229,10 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player)
}
}
- //Get instance where player is bound
- InstancePlayerBind* boundedInstance = player->GetBoundInstance(mapid, player->GetDifficulty());
- Map *boundedMap;
-
- //Search player's instance map
- for(MapMapType::iterator itr = i_maps.find(mapid); itr != i_maps.end(); )
- {
- Map *map = itr->second;
- if(!map->Instanceable())
- break;
- MapInstanced::InstancedMaps &maps = ((MapInstanced *)map)->GetInstancedMaps();
- for(MapInstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr)
- if (boundedInstance->save->GetInstanceId() == mitr->first)
- boundedMap = map;
- }
- //Encounters in progress
- if (boundedMap && ((InstanceMap*)boundedMap)->GetInstanceData() && ((InstanceMap*)boundedMap)->GetInstanceData()->IsEncounterInProgress())
- {
- sLog.outDebug("MAP: Player '%s' can't enter instance '%s' while an encounter is in progress.", player->GetName(), mapName);
- player->SendTransferAborted(mapid, TRANSFER_ABORT_ZONE_IN_COMBAT);
- return(false);
- }
-
// Requirements
InstanceTemplate const* instance = objmgr.GetInstanceTemplate(mapid);
if(!instance)
return false;
-
- //Instance is full
- if (boundedMap)
- {
- Map::PlayerList const &players = boundedMap->GetPlayers();
- uint8 count = 0;
- for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- ++count;
- if (count == player->GetDifficulty() ? instance->maxPlayersHeroic : instance->maxPlayers)
- {
- sLog.outDebug("MAP: Player '%s' can't enter instance '%s' because it's full.", player->GetName(), mapName);
- player->SendTransferAborted(mapid, TRANSFER_ABORT_MAX_PLAYERS);
- return(false);
- }
- }
return player->Satisfy(objmgr.GetAccessRequirement(instance->access_id), mapid, true);
}