Changeset 141 for trunk/src/game/Map.cpp

Show
Ignore:
Timestamp:
11/19/08 13:39:50 (17 years ago)
Author:
yumileroy
Message:

[svn] Improve TargetedMovement? (TODO: let mob find "near angle" rather than "random angle").
Delete a repeated check in instance canenter().
Fix some spell targets.
Add some sunwell spell sql.
Fix Magtheridons earthquake. (TODO: need to find out why soul transfer has no effect when casted by mobs)
Let Brutallus dual wield. Enable burn (still no script effect).
Quick fix for shadowmoon valley illidan quest crash (wait for author's fix).

Original author: megamage
Date: 2008-10-31 21:42:00-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/Map.cpp

    r120 r141  
    14201420bool InstanceMap::CanEnter(Player *player) 
    14211421{ 
    1422     if(!player->isGameMaster() && i_data && i_data->IsEncounterInProgress()) 
     1422    if(std::find(i_Players.begin(),i_Players.end(),player)!=i_Players.end()) 
     1423    { 
     1424        sLog.outError("InstanceMap::CanEnter - player %s(%u) already in map %d,%d,%d!", player->GetName(), player->GetGUIDLow(), GetId(), GetInstanceId(), GetSpawnMode()); 
     1425        assert(false); 
     1426        return false; 
     1427    } 
     1428 
     1429    // cannot enter if the instance is full (player cap), GMs don't count 
     1430    InstanceTemplate const* iTemplate = objmgr.GetInstanceTemplate(GetId()); 
     1431    if (!player->isGameMaster() && GetPlayersCountExceptGMs() >= iTemplate->maxPlayers) 
     1432    { 
     1433        sLog.outDetail("MAP: Instance '%u' of map '%s' cannot have more than '%u' players. Player '%s' rejected", GetInstanceId(), GetMapName(), iTemplate->maxPlayers, player->GetName()); 
     1434        player->SendTransferAborted(GetId(), TRANSFER_ABORT_MAX_PLAYERS); 
     1435        return false; 
     1436    } 
     1437 
     1438    // cannot enter while players in the instance are in combat 
     1439    Group *pGroup = player->GetGroup(); 
     1440    if(!player->isGameMaster() && pGroup && pGroup->InCombatToInstance(GetInstanceId()) && player->isAlive() && player->GetMapId() != GetId()) 
     1441    { 
     1442        player->SendTransferAborted(GetId(), TRANSFER_ABORT_ZONE_IN_COMBAT); 
     1443        return false; 
     1444    } 
     1445 
     1446    /*if(!player->isGameMaster() && i_data && i_data->IsEncounterInProgress()) 
    14231447    { 
    14241448        sLog.outDebug("InstanceMap::CanEnter - Player '%s' can't enter instance '%s' while an encounter is in progress.", player->GetName(), GetMapName()); 
    14251449        player->SendTransferAborted(GetId(), TRANSFER_ABORT_ZONE_IN_COMBAT); 
    14261450        return false; 
    1427     } 
    1428  
    1429     if(std::find(i_Players.begin(),i_Players.end(),player)!=i_Players.end()) 
    1430     { 
    1431         sLog.outError("InstanceMap::CanEnter - player %s(%u) already in map %d,%d,%d!", player->GetName(), player->GetGUIDLow(), GetId(), GetInstanceId(), GetSpawnMode()); 
    1432         assert(false); 
    1433         return false; 
    1434     } 
    1435  
    1436     // cannot enter if the instance is full (player cap), GMs don't count 
    1437     InstanceTemplate const* iTemplate = objmgr.GetInstanceTemplate(GetId()); 
    1438     if (!player->isGameMaster() && GetPlayersCountExceptGMs() >= iTemplate->maxPlayers) 
    1439     { 
    1440         sLog.outDetail("MAP: Instance '%u' of map '%s' cannot have more than '%u' players. Player '%s' rejected", GetInstanceId(), GetMapName(), iTemplate->maxPlayers, player->GetName()); 
    1441         player->SendTransferAborted(GetId(), TRANSFER_ABORT_MAX_PLAYERS); 
    1442         return false; 
    1443     } 
    1444  
    1445     // cannot enter while players in the instance are in combat 
    1446     Group *pGroup = player->GetGroup(); 
    1447     if(pGroup && pGroup->InCombatToInstance(GetInstanceId()) && player->isAlive() && player->GetMapId() != GetId()) 
    1448     { 
    1449         player->SendTransferAborted(GetId(), TRANSFER_ABORT_ZONE_IN_COMBAT); 
    1450         return false; 
    1451     } 
     1451    }*/ 
    14521452 
    14531453    return Map::CanEnter(player);