mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
*Update to Mangos 7151.
--HG-- branch : trunk
This commit is contained in:
@@ -1767,10 +1767,10 @@ bool InstanceMap::CanEnter(Player *player)
|
||||
}
|
||||
|
||||
// cannot enter if the instance is full (player cap), GMs don't count
|
||||
InstanceTemplate const* iTemplate = objmgr.GetInstanceTemplate(GetId());
|
||||
if (!player->isGameMaster() && GetPlayersCountExceptGMs() >= iTemplate->maxPlayers)
|
||||
uint32 maxPlayers = GetMaxPlayers();
|
||||
if (!player->isGameMaster() && GetPlayersCountExceptGMs() >= maxPlayers)
|
||||
{
|
||||
sLog.outDetail("MAP: Instance '%u' of map '%s' cannot have more than '%u' players. Player '%s' rejected", GetInstanceId(), GetMapName(), iTemplate->maxPlayers, player->GetName());
|
||||
sLog.outDetail("MAP: Instance '%u' of map '%s' cannot have more than '%u' players. Player '%s' rejected", GetInstanceId(), GetMapName(), maxPlayers, player->GetName());
|
||||
player->SendTransferAborted(GetId(), TRANSFER_ABORT_MAX_PLAYERS);
|
||||
return false;
|
||||
}
|
||||
@@ -2080,6 +2080,14 @@ void InstanceMap::SetResetSchedule(bool on)
|
||||
}
|
||||
}
|
||||
|
||||
uint32 InstanceMap::GetMaxPlayers() const
|
||||
{
|
||||
InstanceTemplate const* iTemplate = objmgr.GetInstanceTemplate(GetId());
|
||||
if(!iTemplate)
|
||||
return 0;
|
||||
return IsHeroic() ? iTemplate->maxPlayersHeroic : iTemplate->maxPlayers;
|
||||
}
|
||||
|
||||
/* ******* Battleground Instance Maps ******* */
|
||||
|
||||
BattleGroundMap::BattleGroundMap(uint32 id, time_t expiry, uint32 InstanceId)
|
||||
|
||||
Reference in New Issue
Block a user