[8789] Rename several singleton macros to use more consistent names.

* objmgr -> sObjectMgr
 * spellmgr -> sSpellMgr
 * WaypointMgr -> sWaypointMgr
 * poolhandler -> sPoolMgr
 * objaccessor -> sObjectAccessor
 * mapmgr -> sMapMgr
 * sInstanceSaveManager -> sInstanceSaveMgr
 * ticketmgr -> sTicketMgr
 * CreatureEAI_Mgr -> sEventAIMgr
 * auctionmgr -> sAuctionMgr
 * achievementmgr -> sAchievementMgr
This commit is contained in:
XTZGZoReX 2009-11-08 12:11:18 +01:00
parent 539072fcbd
commit 0734adb746
84 changed files with 1113 additions and 1113 deletions

View file

@ -305,7 +305,7 @@ void GameEventMgr::LoadFromDB()
if(newModelEquipSet.equipment_id > 0)
{
if(!objmgr.GetEquipmentInfo(newModelEquipSet.equipment_id))
if(!sObjectMgr.GetEquipmentInfo(newModelEquipSet.equipment_id))
{
sLog.outErrorDb("Table `game_event_model_equip` have creature (Guid: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.", guid, newModelEquipSet.equipment_id);
continue;
@ -399,7 +399,7 @@ void GameEventMgr::LoadFromDB()
continue;
}
if (!poolhandler.CheckPool(entry))
if (!sPoolMgr.CheckPool(entry))
{
sLog.outErrorDb("Pool Id (%u) has all creatures or gameobjects with explicit chance sum <>100 and no equal chance defined. The pool system cannot pick one to spawn.", entry);
continue;
@ -514,13 +514,13 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
for (GuidList::iterator itr = mGameEventCreatureGuids[internal_event_id].begin();itr != mGameEventCreatureGuids[internal_event_id].end();++itr)
{
// Add to correct cell
CreatureData const* data = objmgr.GetCreatureData(*itr);
CreatureData const* data = sObjectMgr.GetCreatureData(*itr);
if (data)
{
objmgr.AddCreatureToGrid(*itr, data);
sObjectMgr.AddCreatureToGrid(*itr, data);
// Spawn if necessary (loaded grids only)
Map* map = const_cast<Map*>(mapmgr.CreateBaseMap(data->mapid));
Map* map = const_cast<Map*>(sMapMgr.CreateBaseMap(data->mapid));
// We use spawn coords to spawn
if(!map->Instanceable() && map->IsLoaded(data->posX,data->posY))
{
@ -547,13 +547,13 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
for (GuidList::iterator itr = mGameEventGameobjectGuids[internal_event_id].begin();itr != mGameEventGameobjectGuids[internal_event_id].end();++itr)
{
// Add to correct cell
GameObjectData const* data = objmgr.GetGOData(*itr);
GameObjectData const* data = sObjectMgr.GetGOData(*itr);
if (data)
{
objmgr.AddGameobjectToGrid(*itr, data);
sObjectMgr.AddGameobjectToGrid(*itr, data);
// Spawn if necessary (loaded grids only)
// this base map checked as non-instanced and then only existed
Map* map = const_cast<Map*>(mapmgr.CreateBaseMap(data->mapid));
Map* map = const_cast<Map*>(sMapMgr.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))
{
@ -580,9 +580,9 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
for (IdList::iterator itr = mGameEventPoolIds[internal_event_id].begin();itr != mGameEventPoolIds[internal_event_id].end();++itr)
{
poolhandler.SpawnPool(*itr, 0, 0);
poolhandler.SpawnPool(*itr, 0, TYPEID_GAMEOBJECT);
poolhandler.SpawnPool(*itr, 0, TYPEID_UNIT);
sPoolMgr.SpawnPool(*itr, 0, 0);
sPoolMgr.SpawnPool(*itr, 0, TYPEID_GAMEOBJECT);
sPoolMgr.SpawnPool(*itr, 0, TYPEID_UNIT);
}
}
@ -599,9 +599,9 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
for (GuidList::iterator itr = mGameEventCreatureGuids[internal_event_id].begin();itr != mGameEventCreatureGuids[internal_event_id].end();++itr)
{
// Remove the creature from grid
if( CreatureData const* data = objmgr.GetCreatureData(*itr) )
if( CreatureData const* data = sObjectMgr.GetCreatureData(*itr) )
{
objmgr.RemoveCreatureFromGrid(*itr, data);
sObjectMgr.RemoveCreatureFromGrid(*itr, data);
if( Creature* pCreature = ObjectAccessor::GetCreatureInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_UNIT)) )
pCreature->AddObjectToRemoveList();
@ -617,9 +617,9 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
for (GuidList::iterator itr = mGameEventGameobjectGuids[internal_event_id].begin();itr != mGameEventGameobjectGuids[internal_event_id].end();++itr)
{
// Remove the gameobject from grid
if(GameObjectData const* data = objmgr.GetGOData(*itr))
if(GameObjectData const* data = sObjectMgr.GetGOData(*itr))
{
objmgr.RemoveGameobjectFromGrid(*itr, data);
sObjectMgr.RemoveGameobjectFromGrid(*itr, data);
if( GameObject* pGameobject = ObjectAccessor::GetGameObjectInWorld(MAKE_NEW_GUID(*itr, data->id, HIGHGUID_GAMEOBJECT)) )
pGameobject->AddObjectToRemoveList();
@ -633,7 +633,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
for (IdList::iterator itr = mGameEventPoolIds[internal_event_id].begin();itr != mGameEventPoolIds[internal_event_id].end();++itr)
{
poolhandler.DespawnPool(*itr);
sPoolMgr.DespawnPool(*itr);
}
}
@ -642,7 +642,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
for(ModelEquipList::iterator itr = mGameEventModelEquip[event_id].begin();itr != mGameEventModelEquip[event_id].end();++itr)
{
// Remove the creature from grid
CreatureData const* data = objmgr.GetCreatureData(itr->first);
CreatureData const* data = sObjectMgr.GetCreatureData(itr->first);
if(!data)
continue;
@ -657,7 +657,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
pCreature->LoadEquipment(itr->second.equipment_id, true);
if (itr->second.modelid >0 && itr->second.modelid_prev != itr->second.modelid)
{
CreatureModelInfo const *minfo = objmgr.GetCreatureModelInfo(itr->second.modelid);
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(itr->second.modelid);
if (minfo)
{
pCreature->SetDisplayId(itr->second.modelid);
@ -672,7 +672,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
pCreature->LoadEquipment(itr->second.equipement_id_prev, true);
if (itr->second.modelid_prev >0 && itr->second.modelid_prev != itr->second.modelid)
{
CreatureModelInfo const *minfo = objmgr.GetCreatureModelInfo(itr->second.modelid_prev);
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(itr->second.modelid_prev);
if (minfo)
{
pCreature->SetDisplayId(itr->second.modelid_prev);
@ -685,12 +685,12 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
}
else // If not spawned
{
CreatureData const* data2 = objmgr.GetCreatureData(itr->first);
CreatureData const* data2 = sObjectMgr.GetCreatureData(itr->first);
if (data2 && activate)
{
CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(data2->id);
uint32 display_id = objmgr.ChooseDisplayId(0,cinfo,data2);
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id);
uint32 display_id = sObjectMgr.ChooseDisplayId(0,cinfo,data2);
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
if (minfo)
display_id = minfo->modelid;
@ -703,7 +703,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
}
// now last step: put in data
// just to have write access to it
CreatureData& data2 = objmgr.NewOrExistCreatureData(itr->first);
CreatureData& data2 = sObjectMgr.NewOrExistCreatureData(itr->first);
if (activate)
{
data2.displayid = itr->second.modelid;
@ -722,7 +722,7 @@ void GameEventMgr::UpdateEventQuests(uint16 event_id, bool Activate)
QuestRelList::iterator itr;
for (itr = mGameEventQuests[event_id].begin();itr != mGameEventQuests[event_id].end();++itr)
{
QuestRelations &CreatureQuestMap = objmgr.mCreatureQuestRelations;
QuestRelations &CreatureQuestMap = sObjectMgr.mCreatureQuestRelations;
if (Activate) // Add the pair(id,quest) to the multimap
CreatureQuestMap.insert(QuestRelations::value_type(itr->first, itr->second));
else