diff options
Diffstat (limited to 'src/game/MapManager.cpp')
-rw-r--r-- | src/game/MapManager.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/game/MapManager.cpp b/src/game/MapManager.cpp index 5b1dc609d56..7947c8d0089 100644 --- a/src/game/MapManager.cpp +++ b/src/game/MapManager.cpp @@ -263,11 +263,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player) int8 maxPlayers = (player->GetDifficulty() == DIFFICULTY_HEROIC) ? instance->maxPlayersHeroic : instance->maxPlayers; if (maxPlayers != -1) //-1: unlimited access { - Map::PlayerList const &players = boundedMap->GetPlayers(); - uint8 count = 0; - for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - ++count; - if (count >= maxPlayers) + if (boundedMap->GetPlayers().getSize() >= 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); |