aboutsummaryrefslogtreecommitdiff
path: root/src/game/Map.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2008-10-27 08:00:33 -0500
committermegamage <none@none>2008-10-27 08:00:33 -0500
commit1f7ff8104987d1af56284bd67489b1f3bb705680 (patch)
treea4f63fa39ba82c0d8c21c5e1c9b7ce7b6ddfee0d /src/game/Map.cpp
parente2c221b0da15d545da3e3d3f9f9e4da7e00a38be (diff)
[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
Diffstat (limited to 'src/game/Map.cpp')
-rw-r--r--src/game/Map.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index 85fc6421a52..9deb86855a6 100644
--- a/src/game/Map.cpp
+++ b/src/game/Map.cpp
@@ -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());