diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp index 1cc08ada4..bd204cded 100644 --- a/src/game/AchievementMgr.cpp +++ b/src/game/AchievementMgr.cpp @@ -886,7 +886,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if(!miscvalue1) continue; - Map const* map = GetPlayer()->IsInWorld() ? GetPlayer()->GetMap() : MapManager::Instance().FindMap(GetPlayer()->GetMapId(), GetPlayer()->GetInstanceId()); + Map const* map = GetPlayer()->IsInWorld() ? GetPlayer()->GetMap() : mapmgr.FindMap(GetPlayer()->GetMapId(), GetPlayer()->GetInstanceId()); if(!map || !map->IsDungeon()) continue; diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp index 0e9784e5f..d57cc39ea 100644 --- a/src/game/BattleGroundMgr.cpp +++ b/src/game/BattleGroundMgr.cpp @@ -1597,7 +1597,7 @@ BattleGround * BattleGroundMgr::CreateNewBattleGround(BattleGroundTypeId bgTypeI } // generate a new instance id - bg->SetInstanceID(MapManager::Instance().GenerateInstanceId()); // set instance id + bg->SetInstanceID(mapmgr.GenerateInstanceId()); // set instance id bg->SetClientInstanceID(CreateClientVisibleInstanceId(bgTypeId, queue_id)); // reset the new bg (set status to status_wait_queue from status_none) diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp index aa550947b..2a9574cf2 100644 --- a/src/game/CharacterHandler.cpp +++ b/src/game/CharacterHandler.cpp @@ -699,7 +699,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder *holder) pCurrChar->TeleportTo(pCurrChar->m_homebindMapId, pCurrChar->m_homebindX, pCurrChar->m_homebindY, pCurrChar->m_homebindZ, pCurrChar->GetOrientation()); } - ObjectAccessor::Instance().AddObject(pCurrChar); + objaccessor.AddObject(pCurrChar); //sLog.outDebug("Player %s added to Map.",pCurrChar->GetName()); pCurrChar->SendInitialPacketsAfterAddToMap(); diff --git a/src/game/Corpse.cpp b/src/game/Corpse.cpp index 166bc34ce..a5b6a73b6 100644 --- a/src/game/Corpse.cpp +++ b/src/game/Corpse.cpp @@ -50,7 +50,7 @@ void Corpse::AddToWorld() { ///- Register the corpse for guid lookup if(!IsInWorld()) - ObjectAccessor::Instance().AddObject(this); + objaccessor.AddObject(this); Object::AddToWorld(); } @@ -59,7 +59,7 @@ void Corpse::RemoveFromWorld() { ///- Remove the corpse from the accessor if(IsInWorld()) - ObjectAccessor::Instance().RemoveObject(this); + objaccessor.RemoveObject(this); Object::RemoveFromWorld(); } diff --git a/src/game/GMTicketHandler.cpp b/src/game/GMTicketHandler.cpp index 4e062ac9f..6c02aa842 100644 --- a/src/game/GMTicketHandler.cpp +++ b/src/game/GMTicketHandler.cpp @@ -116,7 +116,7 @@ void WorldSession::HandleGMTicketCreateOpcode( WorldPacket & recv_data ) DEBUG_LOG("update the ticket"); //TODO: Guard player map - HashMapHolder::MapType &m = ObjectAccessor::Instance().GetPlayers(); + HashMapHolder::MapType &m = objaccessor.GetPlayers(); for(HashMapHolder::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr) { if(itr->second->GetSession()->GetSecurity() >= SEC_GAMEMASTER && itr->second->isAcceptTickets()) diff --git a/src/game/GameEventMgr.cpp b/src/game/GameEventMgr.cpp index 4f6627629..1e425aed7 100644 --- a/src/game/GameEventMgr.cpp +++ b/src/game/GameEventMgr.cpp @@ -520,7 +520,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id) objmgr.AddCreatureToGrid(*itr, data); // Spawn if necessary (loaded grids only) - Map* map = const_cast(MapManager::Instance().CreateBaseMap(data->mapid)); + Map* map = const_cast(mapmgr.CreateBaseMap(data->mapid)); // We use spawn coords to spawn if(!map->Instanceable() && map->IsLoaded(data->posX,data->posY)) { @@ -553,7 +553,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id) objmgr.AddGameobjectToGrid(*itr, data); // Spawn if necessary (loaded grids only) // this base map checked as non-instanced and then only existed - Map* map = const_cast(MapManager::Instance().CreateBaseMap(data->mapid)); + Map* map = const_cast(mapmgr.CreateBaseMap(data->mapid)); // We use current coords to unspawn, not spawn coords since creature can have changed grid if(!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) { diff --git a/src/game/GlobalEvents.cpp b/src/game/GlobalEvents.cpp index 2a03c05f8..79dc9b7c1 100644 --- a/src/game/GlobalEvents.cpp +++ b/src/game/GlobalEvents.cpp @@ -51,7 +51,7 @@ static void CorpsesEraseCallBack(QueryResult *result, bool bones) /// Resurrectable - convert corpses to bones if(!bones) { - if(!ObjectAccessor::Instance().ConvertCorpseForPlayer(player_guid)) + if(!objaccessor.ConvertCorpseForPlayer(player_guid)) { sLog.outDebug("Corpse %u not found in world or bones creating forbidden. Delete from DB.",guidlow); CharacterDatabase.PExecute("DELETE FROM corpse WHERE guid = '%u'",guidlow); @@ -60,7 +60,7 @@ static void CorpsesEraseCallBack(QueryResult *result, bool bones) else ///- or delete bones { - MapManager::Instance().RemoveBonesFromMap(mapid, guid, positionX, positionY); + mapmgr.RemoveBonesFromMap(mapid, guid, positionX, positionY); ///- remove bones from the database CharacterDatabase.PExecute("DELETE FROM corpse WHERE guid = '%u'",guidlow); diff --git a/src/game/Group.cpp b/src/game/Group.cpp index 5750ac1c8..49db5d59c 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -1561,7 +1561,7 @@ void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo) bool isEmpty = true; // if the map is loaded, reset it - Map *map = MapManager::Instance().FindMap(p->GetMapId(), p->GetInstanceId()); + Map *map = mapmgr.FindMap(p->GetMapId(), p->GetInstanceId()); if(map && map->IsDungeon() && !(method == INSTANCE_RESET_GROUP_DISBAND && !p->CanReset())) isEmpty = ((InstanceMap*)map)->Reset(method); diff --git a/src/game/InstanceSaveMgr.cpp b/src/game/InstanceSaveMgr.cpp index bf2f9c233..98195a8fd 100644 --- a/src/game/InstanceSaveMgr.cpp +++ b/src/game/InstanceSaveMgr.cpp @@ -168,7 +168,7 @@ void InstanceSave::SaveToDB() // save instance data too std::string data; - Map *map = MapManager::Instance().FindMap(GetMapId(),m_instanceid); + Map *map = mapmgr.FindMap(GetMapId(),m_instanceid); if(map) { assert(map->IsDungeon()); @@ -567,7 +567,7 @@ void InstanceSaveManager::_ResetSave(InstanceSaveHashMap::iterator &itr) void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId) { sLog.outDebug("InstanceSaveMgr::_ResetInstance %u, %u", mapid, instanceId); - Map *map = (MapInstanced*)MapManager::Instance().CreateBaseMap(mapid); + Map *map = (MapInstanced*)mapmgr.CreateBaseMap(mapid); if(!map->Instanceable()) return; @@ -584,7 +584,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, bool warn, uint32 timeLe { // global reset for all instances of the given map // note: this isn't fast but it's meant to be executed very rarely - Map const *map = MapManager::Instance().CreateBaseMap(mapid); + Map const *map = mapmgr.CreateBaseMap(mapid); if(!map->Instanceable()) return; uint64 now = (uint64)time(NULL); diff --git a/src/game/LFGHandler.cpp b/src/game/LFGHandler.cpp index a325afee5..d31c6ecac 100644 --- a/src/game/LFGHandler.cpp +++ b/src/game/LFGHandler.cpp @@ -31,7 +31,7 @@ static void AttemptJoin(Player* _player) return; //TODO: Guard Player Map - HashMapHolder::MapType const& players = ObjectAccessor::Instance().GetPlayers(); + HashMapHolder::MapType const& players = objaccessor.GetPlayers(); for(HashMapHolder::MapType::const_iterator iter = players.begin(); iter != players.end(); ++iter) { Player *plr = iter->second; @@ -91,7 +91,7 @@ static void AttemptAddMore(Player* _player) return; //TODO: Guard Player map - HashMapHolder::MapType const& players = ObjectAccessor::Instance().GetPlayers(); + HashMapHolder::MapType const& players = objaccessor.GetPlayers(); for(HashMapHolder::MapType::const_iterator iter = players.begin(); iter != players.end(); ++iter) { Player *plr = iter->second; @@ -302,7 +302,7 @@ void WorldSession::SendLfgResult(uint32 type, uint32 entry, uint8 lfg_type) data << uint32(0); // unk //TODO: Guard Player map - HashMapHolder::MapType const& players = ObjectAccessor::Instance().GetPlayers(); + HashMapHolder::MapType const& players = objaccessor.GetPlayers(); for(HashMapHolder::MapType::const_iterator iter = players.begin(); iter != players.end(); ++iter) { Player *plr = iter->second; diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp index b79283248..5e7a2ab8f 100644 --- a/src/game/Level1.cpp +++ b/src/game/Level1.cpp @@ -1967,7 +1967,7 @@ bool ChatHandler::HandleWhispersCommand(const char* args) //Save all players in the world bool ChatHandler::HandleSaveAllCommand(const char* /*args*/) { - ObjectAccessor::Instance().SaveAllPlayers(); + objaccessor.SaveAllPlayers(); SendSysMessage(LANG_PLAYERS_SAVED); return true; } @@ -2080,7 +2080,7 @@ bool ChatHandler::HandleTeleNameCommand(const char * args) PSendSysMessage(LANG_TELEPORTING_TO, nameLink.c_str(), GetMangosString(LANG_OFFLINE), tele->name.c_str()); Player::SavePositionInDB(tele->mapId,tele->position_x,tele->position_y,tele->position_z,tele->orientation, - MapManager::Instance().GetZoneId(tele->mapId,tele->position_x,tele->position_y,tele->position_z),target_guid); + mapmgr.GetZoneId(tele->mapId,tele->position_x,tele->position_y,tele->position_z),target_guid); } return true; @@ -2338,7 +2338,7 @@ bool ChatHandler::HandleGoXYCommand(const char* args) else _player->SaveRecallPosition(); - Map const *map = MapManager::Instance().CreateBaseMap(mapid); + Map const *map = mapmgr.CreateBaseMap(mapid); float z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y)); _player->TeleportTo(mapid, x, y, z, _player->GetOrientation()); @@ -2431,7 +2431,7 @@ bool ChatHandler::HandleGoZoneXYCommand(const char* args) // update to parent zone if exist (client map show only zones without parents) AreaTableEntry const* zoneEntry = areaEntry->zone ? GetAreaEntryByAreaID(areaEntry->zone) : areaEntry; - Map const *map = MapManager::Instance().CreateBaseMap(zoneEntry->mapid); + Map const *map = mapmgr.CreateBaseMap(zoneEntry->mapid); if(map->Instanceable()) { @@ -2506,7 +2506,7 @@ bool ChatHandler::HandleGoGridCommand(const char* args) else _player->SaveRecallPosition(); - Map const *map = MapManager::Instance().CreateBaseMap(mapid); + Map const *map = mapmgr.CreateBaseMap(mapid); float z = std::max(map->GetHeight(x, y, MAX_HEIGHT), map->GetWaterLevel(x, y)); _player->TeleportTo(mapid, x, y, z, _player->GetOrientation()); diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 9c3761ae9..898fd519b 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -192,7 +192,7 @@ bool ChatHandler::HandleReloadConfigCommand(const char* /*args*/) { sLog.outString( "Re-Loading config settings..." ); sWorld.LoadConfigSettings(true); - MapManager::Instance().InitializeVisibilityDistanceInfo(); + mapmgr.InitializeVisibilityDistanceInfo(); SendGlobalSysMessage("World config settings reloaded."); return true; } @@ -3515,7 +3515,7 @@ bool ChatHandler::HandleReviveCommand(const char* args) } else // will resurrected at login without corpse - ObjectAccessor::Instance().ConvertCorpseForPlayer(target_guid); + objaccessor.ConvertCorpseForPlayer(target_guid); return true; } @@ -4517,7 +4517,7 @@ bool ChatHandler::HandleResetAllCommand(const char * args) } CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE (at_login & '%u') = '0'",atLogin,atLogin); - HashMapHolder::MapType const& plist = ObjectAccessor::Instance().GetPlayers(); + HashMapHolder::MapType const& plist = objaccessor.GetPlayers(); for(HashMapHolder::MapType::const_iterator itr = plist.begin(); itr != plist.end(); ++itr) itr->second->SetAtLoginFlag(atLogin); @@ -6014,8 +6014,8 @@ bool ChatHandler::HandleInstanceUnbindCommand(const char* args) bool ChatHandler::HandleInstanceStatsCommand(const char* /*args*/) { - PSendSysMessage("instances loaded: %d", MapManager::Instance().GetNumInstances()); - PSendSysMessage("players in instances: %d", MapManager::Instance().GetNumPlayersInInstances()); + PSendSysMessage("instances loaded: %d", mapmgr.GetNumInstances()); + PSendSysMessage("players in instances: %d", mapmgr.GetNumPlayersInInstances()); PSendSysMessage("instance saves: %d", sInstanceSaveManager.GetNumInstanceSaves()); PSendSysMessage("players bound: %d", sInstanceSaveManager.GetNumBoundPlayersTotal()); PSendSysMessage("groups bound: %d", sInstanceSaveManager.GetNumBoundGroupsTotal()); diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 0114f1ae2..638b20ae9 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -323,7 +323,7 @@ void Map::DeleteFromWorld(T* obj) template<> void Map::DeleteFromWorld(Player* pl) { - ObjectAccessor::Instance().RemoveObject(pl); + objaccessor.RemoveObject(pl); delete pl; } @@ -411,7 +411,7 @@ bool Map::EnsureGridLoaded(const Cell &cell) loader.LoadN(); // Add resurrectable corpses to world object list in grid - ObjectAccessor::Instance().AddCorpsesToGrid(GridPair(cell.GridX(),cell.GridY()),(*grid)(cell.CellX(), cell.CellY()), this); + objaccessor.AddCorpsesToGrid(GridPair(cell.GridX(),cell.GridY()),(*grid)(cell.CellX(), cell.CellY()), this); setGridObjectDataLoaded(true,cell.GridX(), cell.GridY()); return true; @@ -2059,7 +2059,7 @@ void Map::SendInitSelf( Player * player ) void Map::SendInitTransports( Player * player ) { // Hack to send out transports - MapManager::TransportMap& tmap = MapManager::Instance().m_TransportsByMap; + MapManager::TransportMap& tmap = mapmgr.m_TransportsByMap; // no transports at map if (tmap.find(player->GetMapId()) == tmap.end()) @@ -2086,7 +2086,7 @@ void Map::SendInitTransports( Player * player ) void Map::SendRemoveTransports( Player * player ) { // Hack to send out transports - MapManager::TransportMap& tmap = MapManager::Instance().m_TransportsByMap; + MapManager::TransportMap& tmap = mapmgr.m_TransportsByMap; // no transports at map if (tmap.find(player->GetMapId()) == tmap.end()) diff --git a/src/game/MapInstanced.cpp b/src/game/MapInstanced.cpp index 2db10d3be..4d1246d1a 100644 --- a/src/game/MapInstanced.cpp +++ b/src/game/MapInstanced.cpp @@ -166,7 +166,7 @@ Map* MapInstanced::CreateInstance(const uint32 mapId, Player * player) { // if no instanceId via group members or instance saves is found // the instance will be created for the first time - NewInstanceId = MapManager::Instance().GenerateInstanceId(); + NewInstanceId = mapmgr.GenerateInstanceId(); Difficulty diff = player->GetGroup() ? player->GetGroup()->GetDifficulty(IsRaid()) : player->GetDifficulty(IsRaid()); map = CreateInstance(NewInstanceId, NULL, diff); diff --git a/src/game/MapManager.h b/src/game/MapManager.h index 0492f00f2..ea17d4ae4 100644 --- a/src/game/MapManager.h +++ b/src/game/MapManager.h @@ -154,4 +154,7 @@ class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton::MapType& m = ObjectAccessor::Instance().GetPlayers(); + HashMapHolder::MapType& m = objaccessor.GetPlayers(); for(HashMapHolder::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr) { if (security == SEC_PLAYER) diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index cca3c718c..b71ab4f04 100644 --- a/src/game/MovementHandler.cpp +++ b/src/game/MovementHandler.cpp @@ -65,7 +65,7 @@ void WorldSession::HandleMoveWorldportAckOpcode() GetPlayer()->SetSemaphoreTeleportFar(false); // relocate the player to the teleport destination - GetPlayer()->SetMap(MapManager::Instance().CreateMap(loc.mapid, GetPlayer())); + GetPlayer()->SetMap(mapmgr.CreateMap(loc.mapid, GetPlayer())); GetPlayer()->Relocate(loc.coord_x, loc.coord_y, loc.coord_z, loc.orientation); GetPlayer()->SendInitialPacketsBeforeAddToMap(); @@ -274,7 +274,7 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data ) if (plMover && !plMover->m_transport) { // elevators also cause the client to send MOVEMENTFLAG_ONTRANSPORT - just unmount if the guid can be found in the transport list - for (MapManager::TransportSet::const_iterator iter = MapManager::Instance().m_Transports.begin(); iter != MapManager::Instance().m_Transports.end(); ++iter) + for (MapManager::TransportSet::const_iterator iter = mapmgr.m_Transports.begin(); iter != mapmgr.m_Transports.end(); ++iter) { if ((*iter)->GetGUID() == movementInfo.t_guid) { diff --git a/src/game/Object.cpp b/src/game/Object.cpp index ec5d0293b..c37b85348 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1589,7 +1589,7 @@ void WorldObject::BuildMonsterChat(WorldPacket *data, uint8 msgtype, char const* void WorldObject::SendMessageToSet(WorldPacket *data, bool /*bToSelf*/) { //if object is in world, map for it already created! - Map * _map = IsInWorld() ? GetMap() : MapManager::Instance().FindMap(GetMapId(), GetInstanceId()); + Map * _map = IsInWorld() ? GetMap() : mapmgr.FindMap(GetMapId(), GetInstanceId()); if(_map) _map->MessageBroadcast(this, data); } @@ -1597,7 +1597,7 @@ void WorldObject::SendMessageToSet(WorldPacket *data, bool /*bToSelf*/) void WorldObject::SendMessageToSetInRange(WorldPacket *data, float dist, bool /*bToSelf*/) { //if object is in world, map for it already created! - Map * _map = IsInWorld() ? GetMap() : MapManager::Instance().FindMap(GetMapId(), GetInstanceId()); + Map * _map = IsInWorld() ? GetMap() : mapmgr.FindMap(GetMapId(), GetInstanceId()); if(_map) _map->MessageDistBroadcast(this, data, dist); } diff --git a/src/game/ObjectAccessor.cpp b/src/game/ObjectAccessor.cpp index 9e7789e20..40f5b3307 100644 --- a/src/game/ObjectAccessor.cpp +++ b/src/game/ObjectAccessor.cpp @@ -249,7 +249,7 @@ ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia) // remove resurrectable corpse from grid object registry (loaded state checked into call) // do not load the map if it's not loaded - Map *map = MapManager::Instance().FindMap(corpse->GetMapId(), corpse->GetInstanceId()); + Map *map = mapmgr.FindMap(corpse->GetMapId(), corpse->GetInstanceId()); if(map) map->Remove(corpse, false); diff --git a/src/game/ObjectAccessor.h b/src/game/ObjectAccessor.h index 8377724a8..f2aacd985 100644 --- a/src/game/ObjectAccessor.h +++ b/src/game/ObjectAccessor.h @@ -168,4 +168,6 @@ inline Unit* ObjectAccessor::GetUnitInWorld(WorldObject const& obj, uint64 guid) return GetCreatureInWorld(guid); } +#define objaccessor ObjectAccessor::Instance() + #endif diff --git a/src/game/ObjectGridLoader.cpp b/src/game/ObjectGridLoader.cpp index b2096c074..6b4918616 100644 --- a/src/game/ObjectGridLoader.cpp +++ b/src/game/ObjectGridLoader.cpp @@ -147,7 +147,7 @@ void LoadHelper(CellCorpseSet const& cell_corpses, CellPair &cell, CorpseMapType uint32 player_guid = itr->first; - Corpse *obj = ObjectAccessor::Instance().GetCorpseForPlayerGUID(player_guid); + Corpse *obj = objaccessor.GetCorpseForPlayerGUID(player_guid); if(!obj) continue; diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 551e4b325..5410bef43 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -5232,7 +5232,7 @@ void ObjectMgr::LoadGraveyardZones() WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team) { // search for zone associated closest graveyard - uint32 zoneId = MapManager::Instance().GetZoneId(MapId,x,y,z); + uint32 zoneId = mapmgr.GetZoneId(MapId,x,y,z); // Simulate std. algorithm: // found some graveyard associated to (ghost_zone,ghost_map) @@ -6225,7 +6225,7 @@ void ObjectMgr::LoadCorpses() continue; } - ObjectAccessor::Instance().AddCorpse(corpse); + objaccessor.AddCorpse(corpse); ++count; } diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 6590cd1c2..786d52fcc 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -556,7 +556,7 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8 return false; } - SetMap(MapManager::Instance().CreateMap(info->mapId, this)); + SetMap(mapmgr.CreateMap(info->mapId, this)); uint8 powertype = cEntry->powerType; @@ -1680,12 +1680,12 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati // Check enter rights before map getting to avoid creating instance copy for player // this check not dependent from map instance copy and same for all instance copies of selected map - if (!MapManager::Instance().CanPlayerEnter(mapid, this)) + if (!mapmgr.CanPlayerEnter(mapid, this)) return false; // If the map is not created, assume it is possible to enter it. // It will be created in the WorldPortAck. - Map *map = MapManager::Instance().FindMap(mapid); + Map *map = mapmgr.FindMap(mapid); if (!map || map->CanEnter(this)) { //lets reset near teleport flag if it wasn't reset during chained teleports @@ -3887,7 +3887,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC // convert corpse to bones if exist (to prevent exiting Corpse in World without DB entry) // bones will be deleted by corpse/bones deleting thread shortly - ObjectAccessor::Instance().ConvertCorpseForPlayer(playerguid); + objaccessor.ConvertCorpseForPlayer(playerguid); // remove from guild uint32 guildId = GetGuildIdFromDB(playerguid); @@ -4295,18 +4295,18 @@ void Player::CreateCorpse() corpse->SaveToDB(); // register for player, but not show - ObjectAccessor::Instance().AddCorpse(corpse); + objaccessor.AddCorpse(corpse); } void Player::SpawnCorpseBones() { - if(ObjectAccessor::Instance().ConvertCorpseForPlayer(GetGUID())) + if(objaccessor.ConvertCorpseForPlayer(GetGUID())) SaveToDB(); // prevent loading as ghost without corpse } Corpse* Player::GetCorpse() const { - return ObjectAccessor::Instance().GetCorpseForPlayerGUID(GetGUID()); + return objaccessor.GetCorpseForPlayerGUID(GetGUID()); } void Player::DurabilityLossAll(double percent, bool inventory) @@ -5666,7 +5666,7 @@ void Player::SaveRecallPosition() void Player::SendMessageToSet(WorldPacket *data, bool self) { - Map * _map = IsInWorld() ? GetMap() : MapManager::Instance().FindMap(GetMapId(), GetInstanceId()); + Map * _map = IsInWorld() ? GetMap() : mapmgr.FindMap(GetMapId(), GetInstanceId()); if(_map) { _map->MessageBroadcast(this, data, self); @@ -5681,7 +5681,7 @@ void Player::SendMessageToSet(WorldPacket *data, bool self) void Player::SendMessageToSetInRange(WorldPacket *data, float dist, bool self) { - Map * _map = IsInWorld() ? GetMap() : MapManager::Instance().FindMap(GetMapId(), GetInstanceId()); + Map * _map = IsInWorld() ? GetMap() : mapmgr.FindMap(GetMapId(), GetInstanceId()); if(_map) { _map->MessageDistBroadcast(this, data, dist, self); @@ -5694,7 +5694,7 @@ void Player::SendMessageToSetInRange(WorldPacket *data, float dist, bool self) void Player::SendMessageToSetInRange(WorldPacket *data, float dist, bool self, bool own_team_only) { - Map * _map = IsInWorld() ? GetMap() : MapManager::Instance().FindMap(GetMapId(), GetInstanceId()); + Map * _map = IsInWorld() ? GetMap() : mapmgr.FindMap(GetMapId(), GetInstanceId()); if(_map) { _map->MessageDistBroadcast(this, data, dist, self, own_team_only); @@ -6179,7 +6179,7 @@ uint32 Player::GetZoneIdFromDB(uint64 guid) float posz = fields[3].GetFloat(); delete result; - zone = MapManager::Instance().GetZoneId(map,posx,posy,posz); + zone = mapmgr.GetZoneId(map,posx,posy,posz); if (zone > 0) CharacterDatabase.PExecute("UPDATE characters SET zone='%u' WHERE guid='%u'", zone, guidLow); @@ -7347,7 +7347,7 @@ void Player::RemovedInsignia(Player* looterPlr) // We have to convert player corpse to bones, not to be able to resurrect there // SpawnCorpseBones isn't handy, 'cos it saves player while he in BG - Corpse *bones = ObjectAccessor::Instance().ConvertCorpseForPlayer(GetGUID(),true); + Corpse *bones = objaccessor.ConvertCorpseForPlayer(GetGUID(),true); if (!bones) return; @@ -12135,7 +12135,7 @@ void Player::PrepareQuestMenu( uint64 guid ) { //we should obtain map pointer from GetMap() in 99% of cases. Special case //only for quests which cast teleport spells on player - Map * _map = IsInWorld() ? GetMap() : MapManager::Instance().FindMap(GetMapId(), GetInstanceId()); + Map * _map = IsInWorld() ? GetMap() : mapmgr.FindMap(GetMapId(), GetInstanceId()); ASSERT(_map); GameObject *pGameObject = _map->GetGameObject(guid); if( pGameObject ) @@ -12292,7 +12292,7 @@ Quest const * Player::GetNextQuest( uint64 guid, Quest const *pQuest ) { //we should obtain map pointer from GetMap() in 99% of cases. Special case //only for quests which cast teleport spells on player - Map * _map = IsInWorld() ? GetMap() : MapManager::Instance().FindMap(GetMapId(), GetInstanceId()); + Map * _map = IsInWorld() ? GetMap() : mapmgr.FindMap(GetMapId(), GetInstanceId()); ASSERT(_map); GameObject *pGameObject = _map->GetGameObject(guid); if( pGameObject ) @@ -14293,7 +14293,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) if (transGUID != 0) { - for (MapManager::TransportSet::const_iterator iter = MapManager::Instance().m_Transports.begin(); iter != MapManager::Instance().m_Transports.end(); ++iter) + for (MapManager::TransportSet::const_iterator iter = mapmgr.m_Transports.begin(); iter != mapmgr.m_Transports.end(); ++iter) { if( (*iter)->GetGUIDLow() == transGUID) { @@ -14342,7 +14342,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) // NOW player must have valid map // load the player's map here if it's not already loaded - SetMap(MapManager::Instance().CreateMap(GetMapId(), this)); + SetMap(mapmgr.CreateMap(GetMapId(), this)); // if the player is in an instance and it has been reset in the meantime teleport him to the entrance if(GetInstanceId() && !sInstanceSaveManager.GetInstanceSave(GetInstanceId())) @@ -14536,7 +14536,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) //we can be relocated from taxi and still have an outdated Map pointer! //so we need to get a new Map pointer! - SetMap(MapManager::Instance().CreateMap(GetMapId(), this)); + SetMap(mapmgr.CreateMap(GetMapId(), this)); SaveRecallPosition(); // save as recall also to prevent recall and fall from sky m_taxi.ClearTaxiDestinations(); @@ -14808,7 +14808,7 @@ void Player::LoadCorpse() { if( isAlive() ) { - ObjectAccessor::Instance().ConvertCorpseForPlayer(GetGUID()); + objaccessor.ConvertCorpseForPlayer(GetGUID()); } else { @@ -16246,7 +16246,7 @@ void Player::ResetInstances(uint8 method, bool isRaid) } // if the map is loaded, reset it - Map *map = MapManager::Instance().FindMap(p->GetMapId(), p->GetInstanceId()); + Map *map = mapmgr.FindMap(p->GetMapId(), p->GetInstanceId()); if(map && map->IsDungeon()) ((InstanceMap*)map)->Reset(method); diff --git a/src/game/PoolHandler.cpp b/src/game/PoolHandler.cpp index 64b42fa0d..5a22f69fb 100644 --- a/src/game/PoolHandler.cpp +++ b/src/game/PoolHandler.cpp @@ -248,7 +248,7 @@ bool PoolGroup::Spawn1Object(uint32 guid) objmgr.AddCreatureToGrid(guid, data); // Spawn if necessary (loaded grids only) - Map* map = const_cast(MapManager::Instance().CreateBaseMap(data->mapid)); + Map* map = const_cast(mapmgr.CreateBaseMap(data->mapid)); // We use spawn coords to spawn if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) { @@ -276,7 +276,7 @@ bool PoolGroup::Spawn1Object(uint32 guid) objmgr.AddGameobjectToGrid(guid, data); // Spawn if necessary (loaded grids only) // this base map checked as non-instanced and then only existed - Map* map = const_cast(MapManager::Instance().CreateBaseMap(data->mapid)); + Map* map = const_cast(mapmgr.CreateBaseMap(data->mapid)); // We use current coords to unspawn, not spawn coords since creature can have changed grid if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) { diff --git a/src/game/QueryHandler.cpp b/src/game/QueryHandler.cpp index bd48b94b2..52c656cec 100644 --- a/src/game/QueryHandler.cpp +++ b/src/game/QueryHandler.cpp @@ -299,7 +299,7 @@ void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recv_data*/) if(corpseMapEntry->IsDungeon() && corpseMapEntry->entrance_map >= 0) { // if corpse map have entrance - if(Map const* entranceMap = MapManager::Instance().CreateBaseMap(corpseMapEntry->entrance_map)) + if(Map const* entranceMap = mapmgr.CreateBaseMap(corpseMapEntry->entrance_map)) { mapid = corpseMapEntry->entrance_map; x = corpseMapEntry->entrance_x; diff --git a/src/game/Transports.cpp b/src/game/Transports.cpp index 20170172e..d143c2a7d 100644 --- a/src/game/Transports.cpp +++ b/src/game/Transports.cpp @@ -102,7 +102,7 @@ void MapManager::LoadTransports() m_TransportsByMap[*i].insert(t); //If we someday decide to use the grid to track transports, here: - t->SetMap(MapManager::Instance().CreateMap(mapid, t)); + t->SetMap(mapmgr.CreateMap(mapid, t)); //t->GetMap()->Add((GameObject *)t); ++count; @@ -459,7 +459,7 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z) //we need to create and save new Map object with 'newMapid' because if not done -> lead to invalid Map object reference... //player far teleport would try to create same instance, but we need it NOW for transport... //correct me if I'm wrong O.o - Map * newMap = MapManager::Instance().CreateMap(newMapid, this); + Map * newMap = mapmgr.CreateMap(newMapid, this); SetMap(newMap); if(oldMap != newMap) diff --git a/src/game/World.cpp b/src/game/World.cpp index 8efd7bf0f..4624ac8ac 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -569,7 +569,7 @@ void World::LoadConfigSettings(bool reload) m_configs[CONFIG_INTERVAL_GRIDCLEAN] = MIN_GRID_DELAY; } if(reload) - MapManager::Instance().SetGridCleanUpDelay(m_configs[CONFIG_INTERVAL_GRIDCLEAN]); + mapmgr.SetGridCleanUpDelay(m_configs[CONFIG_INTERVAL_GRIDCLEAN]); m_configs[CONFIG_INTERVAL_MAPUPDATE] = sConfig.GetIntDefault("MapUpdateInterval", 100); if(m_configs[CONFIG_INTERVAL_MAPUPDATE] < MIN_MAP_UPDATE_DELAY) @@ -578,7 +578,7 @@ void World::LoadConfigSettings(bool reload) m_configs[CONFIG_INTERVAL_MAPUPDATE] = MIN_MAP_UPDATE_DELAY; } if(reload) - MapManager::Instance().SetMapUpdateInterval(m_configs[CONFIG_INTERVAL_MAPUPDATE]); + mapmgr.SetMapUpdateInterval(m_configs[CONFIG_INTERVAL_MAPUPDATE]); m_configs[CONFIG_INTERVAL_CHANGEWEATHER] = sConfig.GetIntDefault("ChangeWeatherInterval", 10 * MINUTE * IN_MILISECONDS); @@ -1489,7 +1489,7 @@ void World::SetInitialWorldSettings() ///- Initialize MapManager sLog.outString( "Starting Map System" ); - MapManager::Instance().Initialize(); + mapmgr.Initialize(); ///- Initialize Battlegrounds sLog.outString( "Starting BattleGround System" ); @@ -1498,7 +1498,7 @@ void World::SetInitialWorldSettings() //Not sure if this can be moved up in the sequence (with static data loading) as it uses MapManager sLog.outString( "Loading Transports..." ); - MapManager::Instance().LoadTransports(); + mapmgr.LoadTransports(); sLog.outString("Deleting expired bans..." ); loginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate<=UNIX_TIMESTAMP() AND unbandate<>bandate"); @@ -1643,7 +1643,7 @@ void World::Update(uint32 diff) { m_timers[WUPDATE_OBJECTS].Reset(); ///- Update objects when the timer has passed (maps, transport, creatures,...) - MapManager::Instance().Update(diff); // As interval = 0 + mapmgr.Update(diff); // As interval = 0 sBattleGroundMgr.Update(diff); } @@ -1670,7 +1670,7 @@ void World::Update(uint32 diff) /// ///- Move all creatures with "delayed move" and remove and delete all objects with "delayed remove" - MapManager::Instance().DoDelayedMovesAndRemoves(); + mapmgr.DoDelayedMovesAndRemoves(); // update the instance reset times sInstanceSaveManager.Update(); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 1f179117b..755210c68 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8784" + #define REVISION_NR "8785" #endif // __REVISION_NR_H__