diff options
Diffstat (limited to 'src/server/game/Maps/Map.cpp')
-rwxr-xr-x | src/server/game/Maps/Map.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 3bba445b99e..e3bd3518559 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -58,7 +58,7 @@ Map::~Map() while (!i_worldObjects.empty()) { - WorldObject *obj = *i_worldObjects.begin(); + WorldObject* obj = *i_worldObjects.begin(); ASSERT(obj->m_isWorldObject); //ASSERT(obj->GetTypeId() == TYPEID_CORPSE); obj->RemoveFromWorld(); @@ -76,7 +76,7 @@ bool Map::ExistMap(uint32 mapid, int gx, int gy) snprintf(tmp, len, (char *)(sWorld->GetDataPath()+"maps/%03u%02u%02u.map").c_str(), mapid, gx, gy); bool ret = false; - FILE *pf=fopen(tmp, "rb"); + FILE* pf=fopen(tmp, "rb"); if (!pf) sLog->outError("Map file '%s': does not exist!", tmp); @@ -305,8 +305,8 @@ void Map::SwitchGridContainers(T* obj, bool on) obj->m_isWorldObject = on; } -template void Map::SwitchGridContainers(Creature *, bool); -//template void Map::SwitchGridContainers(DynamicObject *, bool); +template void Map::SwitchGridContainers(Creature* , bool); +//template void Map::SwitchGridContainers(DynamicObject* , bool); template<class T> void Map::DeleteFromWorld(T* obj) @@ -524,7 +524,7 @@ void Map::Update(const uint32 t_diff) if (plr && plr->IsInWorld()) { //plr->Update(t_diff); - WorldSession * pSession = plr->GetSession(); + WorldSession* pSession = plr->GetSession(); MapSessionFilter updater(pSession); pSession->Update(t_diff, updater); } @@ -767,7 +767,7 @@ Map::PlayerRelocation(Player* player, float x, float y, float z, float orientati } void -Map::CreatureRelocation(Creature *creature, float x, float y, float z, float ang, bool respawnRelocationOnFail) +Map::CreatureRelocation(Creature* creature, float x, float y, float z, float ang, bool respawnRelocationOnFail) { ASSERT(CheckGridIntegrity(creature, false)); @@ -797,7 +797,7 @@ Map::CreatureRelocation(Creature *creature, float x, float y, float z, float ang ASSERT(CheckGridIntegrity(creature, true)); } -void Map::AddCreatureToMoveList(Creature *c, float x, float y, float z, float ang) +void Map::AddCreatureToMoveList(Creature* c, float x, float y, float z, float ang) { if (!c) return; @@ -849,7 +849,7 @@ void Map::MoveAllCreaturesInMoveList() } } -bool Map::CreatureCellRelocation(Creature *c, Cell new_cell) +bool Map::CreatureCellRelocation(Creature* c, Cell new_cell) { Cell const& old_cell = c->GetCurrentCell(); if (!old_cell.DiffGrid(new_cell)) // in same grid @@ -910,7 +910,7 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell) return false; } -bool Map::CreatureRespawnRelocation(Creature *c) +bool Map::CreatureRespawnRelocation(Creature* c) { float resp_x, resp_y, resp_z, resp_o; c->GetRespawnCoord(resp_x, resp_y, resp_z, &resp_o); @@ -1068,7 +1068,7 @@ bool GridMap::loadData(char *filename) map_fileheader header; // Not return error if file not found - FILE *in = fopen(filename, "rb"); + FILE* in = fopen(filename, "rb"); if (!in) return true; @@ -1124,7 +1124,7 @@ void GridMap::unloadData() m_gridGetHeight = &GridMap::getHeightFromFlat; } -bool GridMap::loadAreaData(FILE *in, uint32 offset, uint32 /*size*/) +bool GridMap::loadAreaData(FILE* in, uint32 offset, uint32 /*size*/) { map_areaHeader header; fseek(in, offset, SEEK_SET); @@ -1142,7 +1142,7 @@ bool GridMap::loadAreaData(FILE *in, uint32 offset, uint32 /*size*/) return true; } -bool GridMap::loadHeihgtData(FILE *in, uint32 offset, uint32 /*size*/) +bool GridMap::loadHeihgtData(FILE* in, uint32 offset, uint32 /*size*/) { map_heightHeader header; fseek(in, offset, SEEK_SET); @@ -1188,7 +1188,7 @@ bool GridMap::loadHeihgtData(FILE *in, uint32 offset, uint32 /*size*/) return true; } -bool GridMap::loadLiquidData(FILE *in, uint32 offset, uint32 /*size*/) +bool GridMap::loadLiquidData(FILE* in, uint32 offset, uint32 /*size*/) { map_liquidHeader header; fseek(in, offset, SEEK_SET); @@ -1483,7 +1483,7 @@ uint8 GridMap::getTerrainType(float x, float y) } // Get water state on map -inline ZLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData *data) +inline ZLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData* data) { // Check water type (if no water return) if (!m_liquid_type && !m_liquidType) @@ -1545,7 +1545,7 @@ inline ZLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 R return LIQUID_MAP_ABOVE_WATER; } -inline GridMap *Map::GetGrid(float x, float y) +inline GridMap* Map::GetGrid(float x, float y) { // half opt method int gx=(int)(32-x/SIZE_OF_GRIDS); //grid x @@ -1561,7 +1561,7 @@ float Map::GetHeight(float x, float y, float z, bool pUseVmaps, float maxSearchD { // find raw .map surface under Z coordinates float mapHeight; - if (GridMap *gmap = const_cast<Map*>(this)->GetGrid(x, y)) + if (GridMap* gmap = const_cast<Map*>(this)->GetGrid(x, y)) { float _mapheight = gmap->getHeight(x, y); @@ -1670,7 +1670,7 @@ bool Map::GetAreaInfo(float x, float y, float z, uint32 &flags, int32 &adtId, in if (vmgr->getAreaInfo(GetId(), x, y, vmap_z, flags, adtId, rootId, groupId)) { // check if there's terrain between player height and object height - if (GridMap *gmap = const_cast<Map*>(this)->GetGrid(x, y)) + if (GridMap* gmap = const_cast<Map*>(this)->GetGrid(x, y)) { float _mapheight = gmap->getHeight(x, y); // z + 2.0f condition taken from GetHeight(), not sure if it's such a great choice... @@ -1704,7 +1704,7 @@ uint16 Map::GetAreaFlag(float x, float y, float z, bool *isOutdoors) const areaflag = atEntry->exploreFlag; else { - if (GridMap *gmap = const_cast<Map*>(this)->GetGrid(x, y)) + if (GridMap* gmap = const_cast<Map*>(this)->GetGrid(x, y)) areaflag = gmap->getArea(x, y); // this used while not all *.map files generated (instances) else @@ -1723,13 +1723,13 @@ uint16 Map::GetAreaFlag(float x, float y, float z, bool *isOutdoors) const uint8 Map::GetTerrainType(float x, float y) const { - if (GridMap *gmap = const_cast<Map*>(this)->GetGrid(x, y)) + if (GridMap* gmap = const_cast<Map*>(this)->GetGrid(x, y)) return gmap->getTerrainType(x, y); else return 0; } -ZLiquidStatus Map::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData *data) const +ZLiquidStatus Map::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData* data) const { ZLiquidStatus result = LIQUID_MAP_NO_WATER; VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager(); @@ -1788,7 +1788,7 @@ float Map::GetWaterLevel(float x, float y) const uint32 Map::GetAreaIdByAreaFlag(uint16 areaflag, uint32 map_id) { - AreaTableEntry const *entry = GetAreaEntryByAreaFlagAndMap(areaflag, map_id); + AreaTableEntry const* entry = GetAreaEntryByAreaFlagAndMap(areaflag, map_id); if (entry) return entry->ID; @@ -1798,7 +1798,7 @@ uint32 Map::GetAreaIdByAreaFlag(uint16 areaflag, uint32 map_id) uint32 Map::GetZoneIdByAreaFlag(uint16 areaflag, uint32 map_id) { - AreaTableEntry const *entry = GetAreaEntryByAreaFlagAndMap(areaflag, map_id); + AreaTableEntry const* entry = GetAreaEntryByAreaFlagAndMap(areaflag, map_id); if (entry) return (entry->zone != 0) ? entry->zone : entry->ID; @@ -1808,19 +1808,19 @@ uint32 Map::GetZoneIdByAreaFlag(uint16 areaflag, uint32 map_id) void Map::GetZoneAndAreaIdByAreaFlag(uint32& zoneid, uint32& areaid, uint16 areaflag, uint32 map_id) { - AreaTableEntry const *entry = GetAreaEntryByAreaFlagAndMap(areaflag, map_id); + AreaTableEntry const* entry = GetAreaEntryByAreaFlagAndMap(areaflag, map_id); areaid = entry ? entry->ID : 0; zoneid = entry ? ((entry->zone != 0) ? entry->zone : entry->ID) : 0; } -bool Map::IsInWater(float x, float y, float pZ, LiquidData *data) const +bool Map::IsInWater(float x, float y, float pZ, LiquidData* data) const { // Check surface in x, y point for liquid if (const_cast<Map*>(this)->GetGrid(x, y)) { LiquidData liquid_status; - LiquidData *liquid_ptr = data ? data : &liquid_status; + LiquidData* liquid_ptr = data ? data : &liquid_status; if (getLiquidStatus(x, y, pZ, MAP_ALL_LIQUIDS, liquid_ptr)) return true; } @@ -1988,7 +1988,7 @@ void Map::DelayedUpdate(const uint32 t_diff) for (GridRefManager<NGridType>::iterator i = GridRefManager<NGridType>::begin(); i != GridRefManager<NGridType>::end();) { NGridType *grid = i->getSource(); - GridInfo *info = i->getSource()->getGridInfoRef(); + GridInfo* info = i->getSource()->getGridInfoRef(); ++i; // The update might delete the map and we need the next map before the iterator gets invalid ASSERT(grid->GetGridState() >= 0 && grid->GetGridState() < MAX_GRID_STATE); si_GridStates[grid->GetGridState()]->Update(*this, *grid, *info, grid->getX(), grid->getY(), t_diff); @@ -1996,7 +1996,7 @@ void Map::DelayedUpdate(const uint32 t_diff) } } -void Map::AddObjectToRemoveList(WorldObject *obj) +void Map::AddObjectToRemoveList(WorldObject* obj) { ASSERT(obj->GetMapId() == GetId() && obj->GetInstanceId() == GetInstanceId()); @@ -2006,7 +2006,7 @@ void Map::AddObjectToRemoveList(WorldObject *obj) //sLog->outDebug(LOG_FILTER_MAPS, "Object (GUID: %u TypeId: %u) added to removing list.", obj->GetGUIDLow(), obj->GetTypeId()); } -void Map::AddObjectToSwitchList(WorldObject *obj, bool on) +void Map::AddObjectToSwitchList(WorldObject* obj, bool on) { ASSERT(obj->GetMapId() == GetId() && obj->GetInstanceId() == GetInstanceId()); @@ -2024,7 +2024,7 @@ void Map::RemoveAllObjectsInRemoveList() while (!i_objectsToSwitch.empty()) { std::map<WorldObject*, bool>::iterator itr = i_objectsToSwitch.begin(); - WorldObject *obj = itr->first; + WorldObject* obj = itr->first; bool on = itr->second; i_objectsToSwitch.erase(itr); @@ -2176,15 +2176,15 @@ void Map::RemoveFromActive(Creature* c) } } -template void Map::Add(Corpse *); -template void Map::Add(Creature *); -template void Map::Add(GameObject *); -template void Map::Add(DynamicObject *); +template void Map::Add(Corpse* ); +template void Map::Add(Creature* ); +template void Map::Add(GameObject* ); +template void Map::Add(DynamicObject* ); -template void Map::Remove(Corpse *, bool); -template void Map::Remove(Creature *, bool); -template void Map::Remove(GameObject *, bool); -template void Map::Remove(DynamicObject *, bool); +template void Map::Remove(Corpse* , bool); +template void Map::Remove(Creature* , bool); +template void Map::Remove(GameObject* , bool); +template void Map::Remove(DynamicObject* , bool); /* ******* Dungeon Instance Maps ******* */ @@ -2240,7 +2240,7 @@ bool InstanceMap::CanEnter(Player* player) } // cannot enter while an encounter is in progress on raids - /*Group *pGroup = player->GetGroup(); + /*Group* pGroup = player->GetGroup(); if (!player->isGameMaster() && pGroup && pGroup->InCombatToInstance(GetInstanceId()) && player->GetMapId() != GetId())*/ if (IsRaid() && GetInstanceScript() && GetInstanceScript()->IsEncounterInProgress()) { @@ -2255,7 +2255,7 @@ bool InstanceMap::CanEnter(Player* player) if (!playerList.isEmpty()) for (PlayerList::const_iterator i = playerList.begin(); i != playerList.end(); ++i) - if (Player *iPlayer = i->getSource()) + if (Player* iPlayer = i->getSource()) { if (iPlayer->isGameMaster()) // bypass GMs continue; @@ -2301,7 +2301,7 @@ bool InstanceMap::Add(Player* player) player->AddInstanceEnterTime(GetInstanceId(), time(NULL)); // get or create an instance save for the map - InstanceSave *mapSave = sInstanceSaveMgr->GetInstanceSave(GetInstanceId()); + InstanceSave* mapSave = sInstanceSaveMgr->GetInstanceSave(GetInstanceId()); if (!mapSave) { sLog->outDetail("InstanceMap::Add: creating instance save for map %d spawnmode %d with instance id %d", GetId(), GetSpawnMode(), GetInstanceId()); @@ -2309,7 +2309,7 @@ bool InstanceMap::Add(Player* player) } // check for existing instance binds - InstancePlayerBind *playerBind = player->GetBoundInstance(GetId(), Difficulty(GetSpawnMode())); + InstancePlayerBind* playerBind = player->GetBoundInstance(GetId(), Difficulty(GetSpawnMode())); if (playerBind && playerBind->perm) { // cannot enter other instances if bound permanently @@ -2324,7 +2324,7 @@ bool InstanceMap::Add(Player* player) if (group) { // solo saves should be reset when entering a group - InstanceGroupBind *groupBind = group->GetBoundInstance(this); + InstanceGroupBind* groupBind = group->GetBoundInstance(this); if (playerBind) { sLog->outError("InstanceMap::Add: player %s(%d) is being put into instance %d, %d, %d, %d, %d, %d but he is in group %d and is bound to instance %d, %d, %d, %d, %d, %d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset(), GUID_LOPART(group->GetLeaderGUID()), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset()); @@ -2495,7 +2495,7 @@ void InstanceMap::PermBindAllPlayers(Player* player) if (!IsDungeon()) return; - InstanceSave *save = sInstanceSaveMgr->GetInstanceSave(GetInstanceId()); + InstanceSave* save = sInstanceSaveMgr->GetInstanceSave(GetInstanceId()); if (!save) { sLog->outError("Cannot bind player (GUID: %u, Name: %s), because no instance save is available for instance map (Name: %s, Entry: %u, InstanceId: %u)!", player->GetGUIDLow(), player->GetName(), player->GetMap()->GetMapName(), player->GetMapId(), GetInstanceId()); @@ -2509,7 +2509,7 @@ void InstanceMap::PermBindAllPlayers(Player* player) Player* plr = itr->getSource(); // players inside an instance cannot be bound to other instances // some players may already be permanently bound, in this case nothing happens - InstancePlayerBind *bind = plr->GetBoundInstance(save->GetMapId(), save->GetDifficulty()); + InstancePlayerBind* bind = plr->GetBoundInstance(save->GetMapId(), save->GetDifficulty()); if (!bind || !bind->perm) { plr->BindToInstance(save, true); @@ -2547,7 +2547,7 @@ void InstanceMap::SetResetSchedule(bool on) // it is assumed that the reset time will rarely (if ever) change while the reset is scheduled if (IsDungeon() && !HavePlayers() && !IsRaidOrHeroicDungeon()) { - if (InstanceSave *save = sInstanceSaveMgr->GetInstanceSave(GetInstanceId())) + if (InstanceSave* save = sInstanceSaveMgr->GetInstanceSave(GetInstanceId())) sInstanceSaveMgr->ScheduleReset(on, save->GetResetTime(), InstanceSaveManager::InstResetEvent(0, GetId(), Difficulty(GetSpawnMode()), GetInstanceId())); else sLog->outError("InstanceMap::SetResetSchedule: cannot turn schedule %s, there is no save information for instance (map [id: %u, name: %s], instance id: %u, difficulty: %u)", |