[svn] Make mobs scatter around in melee attack. Patch provided by smellbee.

Fix Join Instance Can Enter while Encounter is in Progress. Patch provided by mknjc.

--HG--
branch : trunk
This commit is contained in:
megamage
2008-10-27 08:00:33 -05:00
parent e2c221b0da
commit 1f7ff81049
4 changed files with 20 additions and 4 deletions

View File

@@ -1419,6 +1419,13 @@ InstanceMap::~InstanceMap()
*/
bool InstanceMap::CanEnter(Player *player)
{
if(!player->isGameMaster() && i_data && i_data->IsEncounterInProgress())
{
sLog.outDebug("InstanceMap::CanEnter - Player '%s' can't enter instance '%s' while an encounter is in progress.", player->GetName(), GetMapName());
player->SendTransferAborted(GetId(), TRANSFER_ABORT_ZONE_IN_COMBAT);
return false;
}
if(std::find(i_Players.begin(),i_Players.end(),player)!=i_Players.end())
{
sLog.outError("InstanceMap::CanEnter - player %s(%u) already in map %d,%d,%d!", player->GetName(), player->GetGUIDLow(), GetId(), GetInstanceId(), GetSpawnMode());