mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
Merge branch 'master' into 303
Conflicts: src/game/SpellEffects.cpp
This commit is contained in:
commit
397efd4fac
29 changed files with 132 additions and 124 deletions
|
|
@ -641,7 +641,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
|
|||
pCurrChar->SetRank(0);
|
||||
}
|
||||
|
||||
if (!MapManager::Instance().GetMap(pCurrChar->GetMapId(), pCurrChar)->Add(pCurrChar))
|
||||
if (!pCurrChar->GetMap()->Add(pCurrChar))
|
||||
{
|
||||
AreaTrigger const* at = objmgr.GetGoBackTrigger(pCurrChar->GetMapId());
|
||||
if(at)
|
||||
|
|
|
|||
|
|
@ -1174,7 +1174,7 @@ GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid
|
|||
|
||||
TypeContainerVisitor<MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker);
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, object_checker, *MapManager::Instance().GetMap(pl->GetMapId(), pl));
|
||||
cell_lock->Visit(cell_lock, object_checker, *pl->GetMap());
|
||||
}
|
||||
|
||||
return obj;
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ void Creature::RemoveCorpse()
|
|||
|
||||
float x,y,z,o;
|
||||
GetRespawnCoord(x, y, z, &o);
|
||||
MapManager::Instance().GetMap(GetMapId(), this)->CreatureRelocation(this,x,y,z,o);
|
||||
GetMap()->CreatureRelocation(this,x,y,z,o);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -337,7 +337,7 @@ void Creature::Update(uint32 diff)
|
|||
//Call AI respawn virtual function
|
||||
i_AI->JustRespawned();
|
||||
|
||||
MapManager::Instance().GetMap(GetMapId(), this)->Add(this);
|
||||
GetMap()->Add(this);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -1681,7 +1681,7 @@ void Creature::CallAssistence()
|
|||
TypeContainerVisitor<MaNGOS::CreatureListSearcher<MaNGOS::AnyAssistCreatureInRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, grid_creature_searcher, *MapManager::Instance().GetMap(GetMapId(), this));
|
||||
cell_lock->Visit(cell_lock, grid_creature_searcher, *GetMap());
|
||||
}
|
||||
|
||||
for(std::list<Creature*>::iterator iter = assistList.begin(); iter != assistList.end(); ++iter)
|
||||
|
|
|
|||
|
|
@ -122,8 +122,8 @@ void DynamicObject::Update(uint32 p_time)
|
|||
TypeContainerVisitor<MaNGOS::DynamicObjectUpdater, GridTypeMapContainer > grid_object_notifier(notifier);
|
||||
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, world_object_notifier, *MapManager::Instance().GetMap(GetMapId(), this));
|
||||
cell_lock->Visit(cell_lock, grid_object_notifier, *MapManager::Instance().GetMap(GetMapId(), this));
|
||||
cell_lock->Visit(cell_lock, world_object_notifier, *GetMap());
|
||||
cell_lock->Visit(cell_lock, grid_object_notifier, *GetMap());
|
||||
|
||||
if(deleteThis)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ void GameObject::Update(uint32 /*p_time*/)
|
|||
return;
|
||||
}
|
||||
// respawn timer
|
||||
MapManager::Instance().GetMap(GetMapId(), this)->Add(this);
|
||||
GetMap()->Add(this);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -325,13 +325,13 @@ void GameObject::Update(uint32 /*p_time*/)
|
|||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
|
||||
TypeContainerVisitor<MaNGOS::UnitSearcher<MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck>, GridTypeMapContainer > grid_object_checker(checker);
|
||||
cell_lock->Visit(cell_lock, grid_object_checker, *MapManager::Instance().GetMap(GetMapId(), this));
|
||||
cell_lock->Visit(cell_lock, grid_object_checker, *GetMap());
|
||||
|
||||
// or unfriendly player/pet
|
||||
if(!ok)
|
||||
{
|
||||
TypeContainerVisitor<MaNGOS::UnitSearcher<MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck>, WorldTypeMapContainer > world_object_checker(checker);
|
||||
cell_lock->Visit(cell_lock, world_object_checker, *MapManager::Instance().GetMap(GetMapId(), this));
|
||||
cell_lock->Visit(cell_lock, world_object_checker, *GetMap());
|
||||
}
|
||||
}
|
||||
else // environmental trap
|
||||
|
|
@ -346,7 +346,7 @@ void GameObject::Update(uint32 /*p_time*/)
|
|||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
|
||||
TypeContainerVisitor<MaNGOS::PlayerSearcher<MaNGOS::AnyPlayerInObjectRangeCheck>, WorldTypeMapContainer > world_object_checker(checker);
|
||||
cell_lock->Visit(cell_lock, world_object_checker, *MapManager::Instance().GetMap(GetMapId(), this));
|
||||
cell_lock->Visit(cell_lock, world_object_checker, *GetMap());
|
||||
ok = p_ok;
|
||||
}
|
||||
|
||||
|
|
@ -460,7 +460,7 @@ void GameObject::Refresh()
|
|||
return;
|
||||
|
||||
if(isSpawned())
|
||||
MapManager::Instance().GetMap(GetMapId(), this)->Add(this);
|
||||
GetMap()->Add(this);
|
||||
}
|
||||
|
||||
void GameObject::AddUniqueUse(Player* player)
|
||||
|
|
@ -803,7 +803,7 @@ void GameObject::TriggeringLinkedGameObject( uint32 trapEntry, Unit* target)
|
|||
|
||||
TypeContainerVisitor<MaNGOS::GameObjectLastSearcher<MaNGOS::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker);
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, object_checker, *MapManager::Instance().GetMap(GetMapId(), this));
|
||||
cell_lock->Visit(cell_lock, object_checker, *GetMap());
|
||||
}
|
||||
|
||||
// found correct GO
|
||||
|
|
@ -825,7 +825,7 @@ GameObject* GameObject::LookupFishingHoleAround(float range)
|
|||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
|
||||
TypeContainerVisitor<MaNGOS::GameObjectSearcher<MaNGOS::NearestGameObjectFishingHole>, GridTypeMapContainer > grid_object_checker(checker);
|
||||
cell_lock->Visit(cell_lock, grid_object_checker, *MapManager::Instance().GetMap(GetMapId(), this));
|
||||
cell_lock->Visit(cell_lock, grid_object_checker, *GetMap());
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@ bool ChatHandler::HandleGPSCommand(const char* args)
|
|||
|
||||
Map2ZoneCoordinates(zone_x,zone_y,zone_id);
|
||||
|
||||
Map const *map = MapManager::Instance().GetMap(obj->GetMapId(), obj);
|
||||
Map const *map = obj->GetMap();
|
||||
float ground_z = map->GetHeight(obj->GetPositionX(), obj->GetPositionY(), MAX_HEIGHT);
|
||||
float floor_z = map->GetHeight(obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ());
|
||||
|
||||
|
|
@ -349,11 +349,11 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
Map* pMap = MapManager::Instance().GetMap(m_session->GetPlayer()->GetMapId(),m_session->GetPlayer());
|
||||
Map* pMap = m_session->GetPlayer()->GetMap();
|
||||
|
||||
if(pMap->Instanceable())
|
||||
{
|
||||
Map* cMap = MapManager::Instance().GetMap(chr->GetMapId(),chr);
|
||||
Map* cMap = chr->GetMap();
|
||||
if( cMap->Instanceable() && cMap->GetInstanceId() != pMap->GetInstanceId() )
|
||||
{
|
||||
// cannot summon from instance to instance
|
||||
|
|
@ -435,7 +435,7 @@ bool ChatHandler::HandleGonameCommand(const char* args)
|
|||
Player *chr = objmgr.GetPlayer(name.c_str());
|
||||
if (chr)
|
||||
{
|
||||
Map* cMap = MapManager::Instance().GetMap(chr->GetMapId(),chr);
|
||||
Map* cMap = chr->GetMap();
|
||||
if(cMap->Instanceable())
|
||||
{
|
||||
// we have to go to instance, and can go to player only if:
|
||||
|
|
@ -2058,7 +2058,7 @@ bool ChatHandler::HandleGroupgoCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
Map* gmMap = MapManager::Instance().GetMap(m_session->GetPlayer()->GetMapId(),m_session->GetPlayer());
|
||||
Map* gmMap = m_session->GetPlayer()->GetMap();
|
||||
bool to_instance = gmMap->Instanceable();
|
||||
|
||||
// we are in instance, and can summon only player in our group with us as lead
|
||||
|
|
@ -2088,7 +2088,7 @@ bool ChatHandler::HandleGroupgoCommand(const char* args)
|
|||
|
||||
if (to_instance)
|
||||
{
|
||||
Map* plMap = MapManager::Instance().GetMap(pl->GetMapId(),pl);
|
||||
Map* plMap = pl->GetMap();
|
||||
|
||||
if ( plMap->Instanceable() && plMap->GetInstanceId() != gmMap->GetInstanceId() )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1056,7 +1056,7 @@ bool ChatHandler::HandleTurnObjectCommand(const char* args)
|
|||
float rot2 = sin(o/2);
|
||||
float rot3 = cos(o/2);
|
||||
|
||||
Map* map = MapManager::Instance().GetMap(obj->GetMapId(),obj);
|
||||
Map* map = obj->GetMap();
|
||||
map->Remove(obj,false);
|
||||
|
||||
obj->Relocate(obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), o);
|
||||
|
|
@ -1140,7 +1140,7 @@ bool ChatHandler::HandleNpcMoveCommand(const char* args)
|
|||
const_cast<CreatureData*>(data)->posZ = z;
|
||||
const_cast<CreatureData*>(data)->orientation = o;
|
||||
}
|
||||
MapManager::Instance().GetMap(pCreature->GetMapId(),pCreature)->CreatureRelocation(pCreature,x, y, z,o);
|
||||
pCreature->GetMap()->CreatureRelocation(pCreature,x, y, z,o);
|
||||
pCreature->GetMotionMaster()->Initialize();
|
||||
if(pCreature->isAlive()) // dead creature will reset movement generator at respawn
|
||||
{
|
||||
|
|
@ -1187,7 +1187,7 @@ bool ChatHandler::HandleMoveObjectCommand(const char* args)
|
|||
{
|
||||
Player *chr = m_session->GetPlayer();
|
||||
|
||||
Map* map = MapManager::Instance().GetMap(obj->GetMapId(),obj);
|
||||
Map* map = obj->GetMap();
|
||||
map->Remove(obj,false);
|
||||
|
||||
obj->Relocate(chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), obj->GetOrientation());
|
||||
|
|
@ -1213,7 +1213,7 @@ bool ChatHandler::HandleMoveObjectCommand(const char* args)
|
|||
return false;
|
||||
}
|
||||
|
||||
Map* map = MapManager::Instance().GetMap(obj->GetMapId(),obj);
|
||||
Map* map = obj->GetMap();
|
||||
map->Remove(obj,false);
|
||||
|
||||
obj->Relocate(x, y, z, obj->GetOrientation());
|
||||
|
|
@ -2675,7 +2675,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
|
|||
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
|
||||
wpCreature2->LoadFromDB(wpCreature2->GetDBTableGUIDLow(), map);
|
||||
map->Add(wpCreature2);
|
||||
//MapManager::Instance().GetMap(npcCreature->GetMapId())->Add(wpCreature2);
|
||||
//npcCreature->GetMap()->Add(wpCreature2);
|
||||
}
|
||||
|
||||
WaypointMgr.SetNodePosition(lowguid, point, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ());
|
||||
|
|
@ -2985,7 +2985,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
|
|||
// To call _LoadGoods(); _LoadQuests(); CreateTrainerSpells();
|
||||
wpCreature->LoadFromDB(wpCreature->GetDBTableGUIDLow(),map);
|
||||
map->Add(wpCreature);
|
||||
//MapManager::Instance().GetMap(wpCreature->GetMapId())->Add(wpCreature);
|
||||
//wpCreature->GetMap()->Add(wpCreature);
|
||||
}while( result->NextRow() );
|
||||
|
||||
// Cleanup memory
|
||||
|
|
@ -4167,7 +4167,7 @@ bool ChatHandler::HandleNpcTameCommand(const char* /*args*/)
|
|||
pet->SetUInt32Value(UNIT_FIELD_LEVEL, level - 1);
|
||||
|
||||
// add to world
|
||||
MapManager::Instance().GetMap(pet->GetMapId(), pet)->Add((Creature*)pet);
|
||||
pet->GetMap()->Add((Creature*)pet);
|
||||
|
||||
// visual effect for levelup
|
||||
pet->SetUInt32Value(UNIT_FIELD_LEVEL, level);
|
||||
|
|
|
|||
|
|
@ -5415,7 +5415,7 @@ bool ChatHandler::HandleRespawnCommand(const char* /*args*/)
|
|||
|
||||
TypeContainerVisitor<MaNGOS::WorldObjectWorker<MaNGOS::RespawnDo>, GridTypeMapContainer > obj_worker(worker);
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, obj_worker, *MapManager::Instance().GetMap(pl->GetMapId(), pl));
|
||||
cell_lock->Visit(cell_lock, obj_worker, *pl->GetMap());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1783,9 +1783,9 @@ void InstanceMap::UnloadAll(bool pForce)
|
|||
Map::UnloadAll(pForce);
|
||||
}
|
||||
|
||||
void InstanceMap::SendResetWarnings(uint32 timeLeft)
|
||||
void InstanceMap::SendResetWarnings(uint32 timeLeft) const
|
||||
{
|
||||
for(MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
for(MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
itr->getSource()->SendInstanceResetWarning(GetId(), timeLeft);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -125,6 +125,7 @@ typedef UNORDERED_MAP<Creature*, CreatureMover> CreatureMoveList;
|
|||
|
||||
class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::ObjectLevelLockable<Map, ZThread::Mutex>
|
||||
{
|
||||
friend class MapReference;
|
||||
public:
|
||||
Map(uint32 id, time_t, uint32 InstanceId, uint8 SpawnMode);
|
||||
virtual ~Map();
|
||||
|
|
@ -251,8 +252,8 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
|
|||
|
||||
void SendToPlayers(WorldPacket const* data) const;
|
||||
|
||||
MapRefManager m_mapRefManager;
|
||||
|
||||
typedef MapRefManager PlayerList;
|
||||
PlayerList const& GetPlayers() const { return m_mapRefManager; }
|
||||
private:
|
||||
void LoadVMap(int pX, int pY);
|
||||
void LoadMap(uint32 mapid, uint32 instanceid, int x,int y);
|
||||
|
|
@ -301,6 +302,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
|
|||
uint32 i_InstanceId;
|
||||
uint32 m_unloadTimer;
|
||||
|
||||
MapRefManager m_mapRefManager;
|
||||
private:
|
||||
typedef GridReadGuard ReadGuard;
|
||||
typedef GridWriteGuard WriteGuard;
|
||||
|
|
@ -340,8 +342,6 @@ enum InstanceResetMethod
|
|||
class MANGOS_DLL_SPEC InstanceMap : public Map
|
||||
{
|
||||
public:
|
||||
typedef std::list<Player *> PlayerList; // online players only
|
||||
|
||||
InstanceMap(uint32 id, time_t, uint32 InstanceId, uint8 SpawnMode);
|
||||
~InstanceMap();
|
||||
bool Add(Player *);
|
||||
|
|
@ -355,7 +355,7 @@ class MANGOS_DLL_SPEC InstanceMap : public Map
|
|||
time_t GetResetTime();
|
||||
void UnloadAll(bool pForce);
|
||||
bool CanEnter(Player* player);
|
||||
void SendResetWarnings(uint32 timeLeft);
|
||||
void SendResetWarnings(uint32 timeLeft) const;
|
||||
void SetResetSchedule(bool on);
|
||||
private:
|
||||
bool m_resetAfterUnload;
|
||||
|
|
|
|||
|
|
@ -337,7 +337,7 @@ uint32 MapManager::GetNumPlayersInInstances()
|
|||
MapInstanced::InstancedMaps &maps = ((MapInstanced *)map)->GetInstancedMaps();
|
||||
for(MapInstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr)
|
||||
if(mitr->second->IsDungeon())
|
||||
ret += ((InstanceMap*)mitr->second)->m_mapRefManager.getSize();
|
||||
ret += ((InstanceMap*)mitr->second)->GetPlayers().getSize();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
|
|||
GetPlayer()->SendInitialPacketsBeforeAddToMap();
|
||||
// the CanEnter checks are done in TeleporTo but conditions may change
|
||||
// while the player is in transit, for example the map may get full
|
||||
if(!MapManager::Instance().GetMap(GetPlayer()->GetMapId(), GetPlayer())->Add(GetPlayer()))
|
||||
if(!GetPlayer()->GetMap()->Add(GetPlayer()))
|
||||
{
|
||||
sLog.outDebug("WORLD: teleport of player %s (%d) to location %d,%f,%f,%f,%f failed", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow(), loc.mapid, loc.x, loc.y, loc.z, loc.o);
|
||||
// teleport the player home
|
||||
|
|
|
|||
|
|
@ -1054,7 +1054,7 @@ uint32 WorldObject::GetAreaId() const
|
|||
|
||||
InstanceData* WorldObject::GetInstanceData()
|
||||
{
|
||||
Map *map = MapManager::Instance().GetMap(m_mapId, this);
|
||||
Map *map = GetMap();
|
||||
return map->IsDungeon() ? ((InstanceMap*)map)->GetInstanceData() : NULL;
|
||||
}
|
||||
|
||||
|
|
@ -1425,12 +1425,12 @@ void WorldObject::BuildTeleportAckMsg(WorldPacket *data, float x, float y, float
|
|||
|
||||
void WorldObject::SendMessageToSet(WorldPacket *data, bool /*bToSelf*/)
|
||||
{
|
||||
MapManager::Instance().GetMap(m_mapId, this)->MessageBroadcast(this, data);
|
||||
GetMap()->MessageBroadcast(this, data);
|
||||
}
|
||||
|
||||
void WorldObject::SendMessageToSetInRange(WorldPacket *data, float dist, bool /*bToSelf*/)
|
||||
{
|
||||
MapManager::Instance().GetMap(m_mapId, this)->MessageDistBroadcast(this, data, dist);
|
||||
GetMap()->MessageDistBroadcast(this, data, dist);
|
||||
}
|
||||
|
||||
void WorldObject::SendObjectDeSpawnAnim(uint64 guid)
|
||||
|
|
@ -1619,8 +1619,8 @@ void WorldObject::GetNearPoint(WorldObject const* searcher, float &x, float &y,
|
|||
TypeContainerVisitor<MaNGOS::WorldObjectWorker<MaNGOS::NearUsedPosDo>, WorldTypeMapContainer > world_obj_worker(worker);
|
||||
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, grid_obj_worker, *MapManager::Instance().GetMap(GetMapId(), this));
|
||||
cell_lock->Visit(cell_lock, world_obj_worker, *MapManager::Instance().GetMap(GetMapId(), this));
|
||||
cell_lock->Visit(cell_lock, grid_obj_worker, *GetMap());
|
||||
cell_lock->Visit(cell_lock, world_obj_worker, *GetMap());
|
||||
}
|
||||
|
||||
// maybe can just place in primary position
|
||||
|
|
|
|||
|
|
@ -142,7 +142,15 @@ Creature*
|
|||
ObjectAccessor::GetCreature(WorldObject const &u, uint64 guid)
|
||||
{
|
||||
Creature * ret = GetObjectInWorld(guid, (Creature*)NULL);
|
||||
if(ret && ret->GetMapId() != u.GetMapId()) ret = NULL;
|
||||
if(!ret)
|
||||
return NULL;
|
||||
|
||||
if(ret->GetMapId() != u.GetMapId())
|
||||
return NULL;
|
||||
|
||||
if(ret->GetInstanceId() != u.GetInstanceId())
|
||||
return NULL;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -335,7 +343,7 @@ ObjectAccessor::_buildChangeObjectForPlayer(WorldObject *obj, UpdateDataMapType
|
|||
WorldObjectChangeAccumulator notifier(*obj, update_players);
|
||||
TypeContainerVisitor<WorldObjectChangeAccumulator, WorldTypeMapContainer > player_notifier(notifier);
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, player_notifier, *MapManager::Instance().GetMap(obj->GetMapId(), obj));
|
||||
cell_lock->Visit(cell_lock, player_notifier, *obj->GetMap());
|
||||
}
|
||||
|
||||
Pet*
|
||||
|
|
@ -533,14 +541,14 @@ ObjectAccessor::UpdateObjectVisibility(WorldObject *obj)
|
|||
CellPair p = MaNGOS::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
|
||||
Cell cell(p);
|
||||
|
||||
MapManager::Instance().GetMap(obj->GetMapId(), obj)->UpdateObjectVisibility(obj,cell,p);
|
||||
obj->GetMap()->UpdateObjectVisibility(obj,cell,p);
|
||||
}
|
||||
|
||||
void ObjectAccessor::UpdateVisibilityForPlayer( Player* player )
|
||||
{
|
||||
CellPair p = MaNGOS::ComputeCellPair(player->GetPositionX(), player->GetPositionY());
|
||||
Cell cell(p);
|
||||
Map* m = MapManager::Instance().GetMap(player->GetMapId(),player);
|
||||
Map* m = player->GetMap();
|
||||
|
||||
m->UpdatePlayerVisibility(player,cell,p);
|
||||
m->UpdateObjectsVisibilityFor(player,cell,p);
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ ObjectGridRespawnMover::Visit(CreatureMapType &m)
|
|||
|
||||
if(cur_cell.DiffGrid(resp_cell))
|
||||
{
|
||||
MapManager::Instance().GetMap(c->GetMapId(), c)->CreatureRespawnRelocation(c);
|
||||
c->GetMap()->CreatureRespawnRelocation(c);
|
||||
// false result ignored: will be unload with other creatures at grid
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1578,7 +1578,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
|
|||
else
|
||||
{
|
||||
// far teleport to another map
|
||||
Map* oldmap = IsInWorld() ? MapManager::Instance().GetMap(GetMapId(), this) : NULL;
|
||||
Map* oldmap = IsInWorld() ? GetMap() : NULL;
|
||||
// check if we can enter before stopping combat / removing pet / totems / interrupting spells
|
||||
|
||||
// Check enter rights before map getting to avoid creating instance copy for player
|
||||
|
|
@ -5172,7 +5172,7 @@ bool Player::SetPosition(float x, float y, float z, float orientation, bool tele
|
|||
return false;
|
||||
}
|
||||
|
||||
Map *m = MapManager::Instance().GetMap(GetMapId(), this);
|
||||
Map *m = GetMap();
|
||||
|
||||
const float old_x = GetPositionX();
|
||||
const float old_y = GetPositionY();
|
||||
|
|
@ -5190,7 +5190,7 @@ bool Player::SetPosition(float x, float y, float z, float orientation, bool tele
|
|||
m->PlayerRelocation(this, x, y, z, orientation);
|
||||
|
||||
// reread after Map::Relocation
|
||||
m = MapManager::Instance().GetMap(GetMapId(), this);
|
||||
m = GetMap();
|
||||
x = GetPositionX();
|
||||
y = GetPositionY();
|
||||
z = GetPositionZ();
|
||||
|
|
@ -5219,17 +5219,17 @@ void Player::SaveRecallPosition()
|
|||
|
||||
void Player::SendMessageToSet(WorldPacket *data, bool self)
|
||||
{
|
||||
MapManager::Instance().GetMap(GetMapId(), this)->MessageBroadcast(this, data, self);
|
||||
GetMap()->MessageBroadcast(this, data, self);
|
||||
}
|
||||
|
||||
void Player::SendMessageToSetInRange(WorldPacket *data, float dist, bool self)
|
||||
{
|
||||
MapManager::Instance().GetMap(GetMapId(), this)->MessageDistBroadcast(this, data, dist, self);
|
||||
GetMap()->MessageDistBroadcast(this, data, dist, self);
|
||||
}
|
||||
|
||||
void Player::SendMessageToSetInRange(WorldPacket *data, float dist, bool self, bool own_team_only)
|
||||
{
|
||||
MapManager::Instance().GetMap(GetMapId(), this)->MessageDistBroadcast(this, data, dist, self,own_team_only);
|
||||
GetMap()->MessageDistBroadcast(this, data, dist, self,own_team_only);
|
||||
}
|
||||
|
||||
void Player::SendDirectMessage(WorldPacket *data)
|
||||
|
|
@ -16444,8 +16444,8 @@ void Player::HandleStealthedUnitsDetection()
|
|||
TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyStealthedCheck >, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, world_unit_searcher, *MapManager::Instance().GetMap(GetMapId(), this));
|
||||
cell_lock->Visit(cell_lock, grid_unit_searcher, *MapManager::Instance().GetMap(GetMapId(), this));
|
||||
cell_lock->Visit(cell_lock, world_unit_searcher, *GetMap());
|
||||
cell_lock->Visit(cell_lock, grid_unit_searcher, *GetMap());
|
||||
|
||||
for (std::list<Unit*>::iterator i = stealthedUnits.begin(); i != stealthedUnits.end();)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -477,12 +477,12 @@ void Spell::FillTargetMap()
|
|||
|
||||
TypeContainerVisitor<MaNGOS::WorldObjectSearcher<MaNGOS::CannibalizeObjectCheck >, GridTypeMapContainer > grid_searcher(searcher);
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, grid_searcher, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, grid_searcher, *m_caster->GetMap());
|
||||
|
||||
if(!result)
|
||||
{
|
||||
TypeContainerVisitor<MaNGOS::WorldObjectSearcher<MaNGOS::CannibalizeObjectCheck >, WorldTypeMapContainer > world_searcher(searcher);
|
||||
cell_lock->Visit(cell_lock, world_searcher, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, world_searcher, *m_caster->GetMap());
|
||||
}
|
||||
|
||||
if(result)
|
||||
|
|
@ -1222,8 +1222,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
|
|||
TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, world_unit_searcher, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, grid_unit_searcher, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, world_unit_searcher, *m_caster->GetMap());
|
||||
cell_lock->Visit(cell_lock, grid_unit_searcher, *m_caster->GetMap());
|
||||
}
|
||||
|
||||
if(tempUnitMap.empty())
|
||||
|
|
@ -1321,8 +1321,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
|
|||
TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, world_unit_searcher, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, grid_unit_searcher, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, world_unit_searcher, *m_caster->GetMap());
|
||||
cell_lock->Visit(cell_lock, grid_unit_searcher, *m_caster->GetMap());
|
||||
}
|
||||
|
||||
tempUnitMap.sort(TargetDistanceOrder(pUnitTarget));
|
||||
|
|
@ -1379,8 +1379,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
|
|||
TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, GridTypeMapContainer > grid_object_notifier(notifier);
|
||||
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, world_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, grid_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, world_object_notifier, *m_caster->GetMap());
|
||||
cell_lock->Visit(cell_lock, grid_object_notifier, *m_caster->GetMap());
|
||||
|
||||
// exclude caster (this can be important if this not original caster)
|
||||
TagUnitMap.remove(m_caster);
|
||||
|
|
@ -1462,8 +1462,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
|
|||
TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, GridTypeMapContainer > grid_object_notifier(notifier);
|
||||
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, world_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, grid_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, world_object_notifier, *m_caster->GetMap());
|
||||
cell_lock->Visit(cell_lock, grid_object_notifier, *m_caster->GetMap());
|
||||
}break;
|
||||
case TARGET_ALL_FRIENDLY_UNITS_AROUND_CASTER:
|
||||
{
|
||||
|
|
@ -1478,8 +1478,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
|
|||
TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, GridTypeMapContainer > grid_object_notifier(notifier);
|
||||
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, world_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, grid_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, world_object_notifier, *m_caster->GetMap());
|
||||
cell_lock->Visit(cell_lock, grid_object_notifier, *m_caster->GetMap());
|
||||
}break;
|
||||
case TARGET_ALL_FRIENDLY_UNITS_IN_AREA:
|
||||
{
|
||||
|
|
@ -1494,8 +1494,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
|
|||
TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, GridTypeMapContainer > grid_object_notifier(notifier);
|
||||
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, world_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, grid_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, world_object_notifier, *m_caster->GetMap());
|
||||
cell_lock->Visit(cell_lock, grid_object_notifier, *m_caster->GetMap());
|
||||
}break;
|
||||
// TARGET_SINGLE_PARTY means that the spells can only be casted on a party member and not on the caster (some seals, fire shield from imp, etc..)
|
||||
case TARGET_SINGLE_PARTY:
|
||||
|
|
@ -1571,8 +1571,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
|
|||
TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, GridTypeMapContainer > grid_object_notifier(notifier);
|
||||
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, world_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, grid_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, world_object_notifier, *m_caster->GetMap());
|
||||
cell_lock->Visit(cell_lock, grid_object_notifier, *m_caster->GetMap());
|
||||
}break;
|
||||
case TARGET_DUELVSPLAYER:
|
||||
{
|
||||
|
|
@ -1621,8 +1621,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
|
|||
TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, GridTypeMapContainer > grid_object_notifier(notifier);
|
||||
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, world_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, grid_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, world_object_notifier, *m_caster->GetMap());
|
||||
cell_lock->Visit(cell_lock, grid_object_notifier, *m_caster->GetMap());
|
||||
}
|
||||
}break;
|
||||
case TARGET_MINION:
|
||||
|
|
@ -1740,8 +1740,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
|
|||
TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, GridTypeMapContainer > grid_object_notifier(notifier);
|
||||
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, world_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, grid_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, world_object_notifier, *m_caster->GetMap());
|
||||
cell_lock->Visit(cell_lock, grid_object_notifier, *m_caster->GetMap());
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1805,8 +1805,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
|
|||
TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, WorldTypeMapContainer > world_notifier(notifier);
|
||||
TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, GridTypeMapContainer > grid_notifier(notifier);
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, world_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, grid_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, world_notifier, *m_caster->GetMap());
|
||||
cell_lock->Visit(cell_lock, grid_notifier, *m_caster->GetMap());
|
||||
}
|
||||
}
|
||||
}break;
|
||||
|
|
@ -1862,8 +1862,8 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
|
|||
TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, GridTypeMapContainer > grid_notifier(notifier);
|
||||
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, world_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, grid_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, world_notifier, *m_caster->GetMap());
|
||||
cell_lock->Visit(cell_lock, grid_notifier, *m_caster->GetMap());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -3461,7 +3461,7 @@ uint8 Spell::CanCast(bool strict)
|
|||
|
||||
TypeContainerVisitor<MaNGOS::GameObjectLastSearcher<MaNGOS::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker);
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, object_checker, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, object_checker, *m_caster->GetMap());
|
||||
|
||||
if(p_GameObject)
|
||||
{
|
||||
|
|
@ -3500,7 +3500,7 @@ uint8 Spell::CanCast(bool strict)
|
|||
TypeContainerVisitor<MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck>, GridTypeMapContainer > grid_creature_searcher(searcher);
|
||||
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, grid_creature_searcher, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, grid_creature_searcher, *m_caster->GetMap());
|
||||
|
||||
if(p_Creature )
|
||||
{
|
||||
|
|
@ -4518,7 +4518,7 @@ uint8 Spell::CheckItems()
|
|||
|
||||
TypeContainerVisitor<MaNGOS::GameObjectSearcher<MaNGOS::GameObjectFocusCheck>, GridTypeMapContainer > object_checker(checker);
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, object_checker, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));
|
||||
cell_lock->Visit(cell_lock, object_checker, *m_caster->GetMap());
|
||||
|
||||
if(!ok)
|
||||
return (uint8)SPELL_FAILED_REQUIRES_SPELL_FOCUS;
|
||||
|
|
|
|||
|
|
@ -733,8 +733,8 @@ void AreaAura::Update(uint32 diff)
|
|||
TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyFriendlyUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
|
||||
TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyFriendlyUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, world_unit_searcher, *MapManager::Instance().GetMap(caster->GetMapId(), caster));
|
||||
cell_lock->Visit(cell_lock, grid_unit_searcher, *MapManager::Instance().GetMap(caster->GetMapId(), caster));
|
||||
cell_lock->Visit(cell_lock, world_unit_searcher, *caster->GetMap());
|
||||
cell_lock->Visit(cell_lock, grid_unit_searcher, *caster->GetMap());
|
||||
break;
|
||||
}
|
||||
case AREA_AURA_ENEMY:
|
||||
|
|
@ -749,8 +749,8 @@ void AreaAura::Update(uint32 diff)
|
|||
TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
|
||||
TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, world_unit_searcher, *MapManager::Instance().GetMap(caster->GetMapId(), caster));
|
||||
cell_lock->Visit(cell_lock, grid_unit_searcher, *MapManager::Instance().GetMap(caster->GetMapId(), caster));
|
||||
cell_lock->Visit(cell_lock, world_unit_searcher, *caster->GetMap());
|
||||
cell_lock->Visit(cell_lock, grid_unit_searcher, *caster->GetMap());
|
||||
break;
|
||||
}
|
||||
case AREA_AURA_OWNER:
|
||||
|
|
|
|||
|
|
@ -1944,7 +1944,7 @@ void Spell::EffectTeleportUnits(uint32 i)
|
|||
((Player*)unitTarget)->TeleportTo(mapid, x, y, z, orientation, TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (unitTarget==m_caster ? TELE_TO_SPELL : 0));
|
||||
else
|
||||
{
|
||||
MapManager::Instance().GetMap(mapid, m_caster)->CreatureRelocation((Creature*)unitTarget, x, y, z, orientation);
|
||||
m_caster->GetMap()->CreatureRelocation((Creature*)unitTarget, x, y, z, orientation);
|
||||
WorldPacket data;
|
||||
unitTarget->BuildTeleportAckMsg(&data, x, y, z, orientation);
|
||||
unitTarget->SendMessageToSet(&data, false);
|
||||
|
|
@ -1970,7 +1970,7 @@ void Spell::EffectTeleportUnits(uint32 i)
|
|||
((Player*)unitTarget)->TeleportTo(mapid, x, y, z, orientation, TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (unitTarget==m_caster ? TELE_TO_SPELL : 0));
|
||||
else
|
||||
{
|
||||
MapManager::Instance().GetMap(mapid, m_caster)->CreatureRelocation((Creature*)unitTarget, x, y, z, orientation);
|
||||
m_caster->GetMap()->CreatureRelocation((Creature*)unitTarget, x, y, z, orientation);
|
||||
WorldPacket data;
|
||||
unitTarget->BuildTeleportAckMsg(&data, x, y, z, orientation);
|
||||
unitTarget->SendMessageToSet(&data, false);
|
||||
|
|
@ -2632,7 +2632,7 @@ void Spell::EffectPersistentAA(uint32 i)
|
|||
dynObj->SetUInt32Value(GAMEOBJECT_DISPLAYID, 368003);
|
||||
dynObj->SetUInt32Value(DYNAMICOBJECT_BYTES, 0x01eeeeee);
|
||||
m_caster->AddDynObject(dynObj);
|
||||
MapManager::Instance().GetMap(dynObj->GetMapId(), dynObj)->Add(dynObj);
|
||||
dynObj->GetMap()->Add(dynObj);
|
||||
}
|
||||
|
||||
void Spell::EffectEnergize(uint32 i)
|
||||
|
|
@ -3473,7 +3473,7 @@ void Spell::EffectAddFarsight(uint32 i)
|
|||
dynObj->SetUInt32Value(OBJECT_FIELD_TYPE, 65);
|
||||
dynObj->SetUInt32Value(DYNAMICOBJECT_BYTES, 0x80000002);
|
||||
m_caster->AddDynObject(dynObj);
|
||||
MapManager::Instance().GetMap(dynObj->GetMapId(), dynObj)->Add(dynObj);
|
||||
dynObj->GetMap()->Add(dynObj);
|
||||
if(m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)m_caster)->SetFarSight(dynObj->GetGUID());
|
||||
}
|
||||
|
|
@ -3671,7 +3671,7 @@ void Spell::EffectTeleUnitsFaceCaster(uint32 i)
|
|||
if(unitTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)unitTarget)->TeleportTo(mapid, fx, fy, fz, -m_caster->GetOrientation(), TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (unitTarget==m_caster ? TELE_TO_SPELL : 0));
|
||||
else
|
||||
MapManager::Instance().GetMap(mapid, m_caster)->CreatureRelocation((Creature*)m_caster, fx, fy, fz, -m_caster->GetOrientation());
|
||||
m_caster->GetMap()->CreatureRelocation((Creature*)m_caster, fx, fy, fz, -m_caster->GetOrientation());
|
||||
}
|
||||
|
||||
void Spell::EffectLearnSkill(uint32 i)
|
||||
|
|
@ -3914,7 +3914,7 @@ void Spell::EffectTameCreature(uint32 /*i*/)
|
|||
pet->SetUInt32Value(UNIT_FIELD_LEVEL, level - 1);
|
||||
|
||||
// add to world
|
||||
MapManager::Instance().GetMap(pet->GetMapId(), pet)->Add((Creature*)pet);
|
||||
pet->GetMap()->Add((Creature*)pet);
|
||||
|
||||
// visual effect for levelup
|
||||
pet->SetUInt32Value(UNIT_FIELD_LEVEL, level);
|
||||
|
|
@ -3944,14 +3944,14 @@ void Spell::EffectSummonPet(uint32 i)
|
|||
if( OldSummon->isDead() )
|
||||
return;
|
||||
|
||||
MapManager::Instance().GetMap(OldSummon->GetMapId(), OldSummon)->Remove((Creature*)OldSummon,false);
|
||||
OldSummon->GetMap()->Remove((Creature*)OldSummon,false);
|
||||
OldSummon->SetMapId(m_caster->GetMapId());
|
||||
|
||||
float px, py, pz;
|
||||
m_caster->GetClosePoint(px, py, pz, OldSummon->GetObjectSize());
|
||||
|
||||
OldSummon->Relocate(px, py, pz, OldSummon->GetOrientation());
|
||||
MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster)->Add((Creature*)OldSummon);
|
||||
m_caster->GetMap()->Add((Creature*)OldSummon);
|
||||
|
||||
if(m_caster->GetTypeId() == TYPEID_PLAYER && OldSummon->isControlled() )
|
||||
{
|
||||
|
|
@ -5485,7 +5485,7 @@ void Spell::EffectMomentMove(uint32 i)
|
|||
if(unitTarget->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)unitTarget)->TeleportTo(mapid, fx, fy, fz, unitTarget->GetOrientation(), TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (unitTarget==m_caster ? TELE_TO_SPELL : 0));
|
||||
else
|
||||
MapManager::Instance().GetMap(mapid, unitTarget)->CreatureRelocation((Creature*)unitTarget, fx, fy, fz, unitTarget->GetOrientation());
|
||||
m_caster->GetMap()->CreatureRelocation((Creature*)unitTarget, fx, fy, fz, unitTarget->GetOrientation());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5595,7 +5595,7 @@ void Spell::EffectCharge(uint32 /*i*/)
|
|||
m_caster->SendMonsterMove(x, y, z, 0, MOVEMENTFLAG_WALK_MODE, 1);
|
||||
|
||||
if(m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster)->CreatureRelocation((Creature*)m_caster,x,y,z,m_caster->GetOrientation());
|
||||
m_caster->GetMap()->CreatureRelocation((Creature*)m_caster,x,y,z,m_caster->GetOrientation());
|
||||
|
||||
// not all charge effects used in negative spells
|
||||
if ( !IsPositiveSpell(m_spellInfo->Id))
|
||||
|
|
@ -6031,7 +6031,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
|
|||
linkedGO->SetSpellId(m_spellInfo->Id);
|
||||
linkedGO->SetOwnerGUID(m_caster->GetGUID() );
|
||||
|
||||
MapManager::Instance().GetMap(linkedGO->GetMapId(), linkedGO)->Add(linkedGO);
|
||||
linkedGO->GetMap()->Add(linkedGO);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ void TemporarySummon::Summon(TempSummonType type, uint32 lifetime)
|
|||
m_timer = lifetime;
|
||||
m_lifetime = lifetime;
|
||||
|
||||
MapManager::Instance().GetMap(GetMapId(), this)->Add((Creature*)this);
|
||||
GetMap()->Add((Creature*)this);
|
||||
|
||||
AIM_Initialize();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,8 +93,8 @@ TotemAI::UpdateAI(const uint32 /*diff*/)
|
|||
TypeContainerVisitor<MaNGOS::UnitLastSearcher<MaNGOS::NearestAttackableUnitInObjectRangeCheck>, WorldTypeMapContainer > world_object_checker(checker);
|
||||
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, grid_object_checker, *MapManager::Instance().GetMap(i_totem.GetMapId(), &i_totem));
|
||||
cell_lock->Visit(cell_lock, world_object_checker, *MapManager::Instance().GetMap(i_totem.GetMapId(), &i_totem));
|
||||
cell_lock->Visit(cell_lock, grid_object_checker, *i_totem.GetMap());
|
||||
cell_lock->Visit(cell_lock, world_object_checker, *i_totem.GetMap());
|
||||
}
|
||||
|
||||
// If have target
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ void MapManager::LoadTransports()
|
|||
|
||||
//If we someday decide to use the grid to track transports, here:
|
||||
//MapManager::Instance().LoadGrid(mapid,x,y,true);
|
||||
//MapManager::Instance().GetMap(t->GetMapId())->Add<GameObject>((GameObject *)t);
|
||||
//t->GetMap()->Add<GameObject>((GameObject *)t);
|
||||
++count;
|
||||
} while(result->NextRow());
|
||||
delete result;
|
||||
|
|
@ -431,11 +431,11 @@ Transport::WayPointMap::iterator Transport::GetNextWayPoint()
|
|||
|
||||
void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
|
||||
{
|
||||
//MapManager::Instance().GetMap(oldMapid)->Remove((GameObject *)this, false);
|
||||
//GetMap()->Remove((GameObject *)this, false);
|
||||
SetMapId(newMapid);
|
||||
//MapManager::Instance().LoadGrid(newMapid,x,y,true);
|
||||
Relocate(x, y, z);
|
||||
//MapManager::Instance().GetMap(newMapid)->Add<GameObject>((GameObject *)this);
|
||||
//GetMap()->Add<GameObject>((GameObject *)this);
|
||||
|
||||
for(PlayerSet::iterator itr = m_passengers.begin(); itr != m_passengers.end();)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ inline float Traveller<Creature>::Speed()
|
|||
template<>
|
||||
inline void Traveller<Creature>::Relocation(float x, float y, float z, float orientation)
|
||||
{
|
||||
MapManager::Instance().GetMap(i_traveller.GetMapId(), &i_traveller)->CreatureRelocation(&i_traveller, x, y, z, orientation);
|
||||
i_traveller.GetMap()->CreatureRelocation(&i_traveller, x, y, z, orientation);
|
||||
}
|
||||
|
||||
template<>
|
||||
|
|
@ -87,7 +87,7 @@ inline float Traveller<Player>::Speed()
|
|||
template<>
|
||||
inline void Traveller<Player>::Relocation(float x, float y, float z, float orientation)
|
||||
{
|
||||
MapManager::Instance().GetMap(i_traveller.GetMapId(), &i_traveller)->PlayerRelocation(&i_traveller, x, y, z, orientation);
|
||||
i_traveller.GetMap()->PlayerRelocation(&i_traveller, x, y, z, orientation);
|
||||
}
|
||||
|
||||
template<>
|
||||
|
|
|
|||
|
|
@ -4112,7 +4112,7 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
|
|||
if (IsSingleTargetSpell(AurSpellInfo))
|
||||
{
|
||||
caster = Aur->GetCaster();
|
||||
if(!caster)
|
||||
if(caster)
|
||||
{
|
||||
AuraList& scAuras = caster->GetSingleCastAuras();
|
||||
scAuras.remove(Aur);
|
||||
|
|
@ -8786,7 +8786,7 @@ void Unit::SetVisibility(UnitVisibility x)
|
|||
|
||||
if(IsInWorld())
|
||||
{
|
||||
Map *m = MapManager::Instance().GetMap(GetMapId(), this);
|
||||
Map *m = GetMap();
|
||||
|
||||
if(GetTypeId()==TYPEID_PLAYER)
|
||||
m->PlayerRelocation((Player*)this,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation());
|
||||
|
|
@ -10549,8 +10549,8 @@ Unit* Unit::SelectNearbyTarget() const
|
|||
TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
|
||||
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, world_unit_searcher, *MapManager::Instance().GetMap(GetMapId(), this));
|
||||
cell_lock->Visit(cell_lock, grid_unit_searcher, *MapManager::Instance().GetMap(GetMapId(), this));
|
||||
cell_lock->Visit(cell_lock, world_unit_searcher, *GetMap());
|
||||
cell_lock->Visit(cell_lock, grid_unit_searcher, *GetMap());
|
||||
}
|
||||
|
||||
// remove current target
|
||||
|
|
|
|||
|
|
@ -1659,7 +1659,7 @@ void World::ScriptsProcess()
|
|||
break;
|
||||
}
|
||||
((Unit *)source)->SendMonsterMoveWithSpeed(step.script->x, step.script->y, step.script->z, ((Unit *)source)->GetUnitMovementFlags(), step.script->datalong2 );
|
||||
MapManager::Instance().GetMap(((Unit *)source)->GetMapId(), ((Unit *)source))->CreatureRelocation(((Creature *)source), step.script->x, step.script->y, step.script->z, 0);
|
||||
((Unit *)source)->GetMap()->CreatureRelocation(((Creature *)source), step.script->x, step.script->y, step.script->z, 0);
|
||||
break;
|
||||
case SCRIPT_COMMAND_FLAG_SET:
|
||||
if(!source)
|
||||
|
|
@ -1785,7 +1785,7 @@ void World::ScriptsProcess()
|
|||
|
||||
TypeContainerVisitor<MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker);
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, object_checker, *MapManager::Instance().GetMap(summoner->GetMapId(), summoner));
|
||||
cell_lock->Visit(cell_lock, object_checker, *summoner->GetMap());
|
||||
|
||||
if ( !go )
|
||||
{
|
||||
|
|
@ -1809,7 +1809,7 @@ void World::ScriptsProcess()
|
|||
go->SetLootState(GO_READY);
|
||||
go->SetRespawnTime(time_to_despawn); //despawn object in ? seconds
|
||||
|
||||
MapManager::Instance().GetMap(go->GetMapId(), go)->Add(go);
|
||||
go->GetMap()->Add(go);
|
||||
break;
|
||||
}
|
||||
case SCRIPT_COMMAND_OPEN_DOOR:
|
||||
|
|
@ -1846,7 +1846,7 @@ void World::ScriptsProcess()
|
|||
|
||||
TypeContainerVisitor<MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker);
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, object_checker, *MapManager::Instance().GetMap(caster->GetMapId(), (Unit*)source));
|
||||
cell_lock->Visit(cell_lock, object_checker, *caster->GetMap());
|
||||
|
||||
if ( !door )
|
||||
{
|
||||
|
|
@ -1902,7 +1902,7 @@ void World::ScriptsProcess()
|
|||
|
||||
TypeContainerVisitor<MaNGOS::GameObjectSearcher<MaNGOS::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker);
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, object_checker, *MapManager::Instance().GetMap(caster->GetMapId(), (Unit*)source));
|
||||
cell_lock->Visit(cell_lock, object_checker, *caster->GetMap());
|
||||
|
||||
if ( !door )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -364,7 +364,7 @@ void WorldSession::LogoutPlayer(bool Save)
|
|||
// the player may not be in the world when logging out
|
||||
// e.g if he got disconnected during a transfer to another map
|
||||
// calls to GetMap in this case may cause crashes
|
||||
if(_player->IsInWorld()) MapManager::Instance().GetMap(_player->GetMapId(), _player)->Remove(_player, false);
|
||||
if(_player->IsInWorld()) _player->GetMap()->Remove(_player, false);
|
||||
// RemoveFromWorld does cleanup that requires the player to be in the accessor
|
||||
ObjectAccessor::Instance().RemoveObject(_player);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "6833"
|
||||
#define REVISION_NR "6836"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/MP"
|
||||
AdditionalOptions="/MP /bigobj"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\shared\vmap;..\..\dep\ACE_wrappers"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;MANGOS_DEBUG;_LIB;"
|
||||
|
|
@ -286,7 +286,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/MP"
|
||||
AdditionalOptions="/MP /bigobj"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\shared\vmap;..\..\dep\ACE_wrappers"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;"
|
||||
|
|
@ -1339,11 +1339,11 @@
|
|||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\game\MapRefManager.h"
|
||||
RelativePath="..\..\src\game\MapReference.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\game\MapReference.h"
|
||||
RelativePath="..\..\src\game\MapRefManager.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/MP"
|
||||
AdditionalOptions="/MP /bigobj"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\shared\vmap;..\..\dep\ACE_wrappers"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;MANGOS_DEBUG;_LIB;"
|
||||
|
|
@ -287,7 +287,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/MP"
|
||||
AdditionalOptions="/MP /bigobj"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\shared\vmap;..\..\dep\ACE_wrappers"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;"
|
||||
|
|
@ -1341,11 +1341,11 @@
|
|||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\game\MapRefManager.h"
|
||||
RelativePath="..\..\src\game\MapReference.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\game\MapReference.h"
|
||||
RelativePath="..\..\src\game\MapRefManager.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue