Core: Get rid of dirty operator workaround for ACE_Singleton class implementation
--HG-- branch : trunk
This commit is contained in:
1 parent
0948fc5bbe
commit
0f3b9019a8
159 files changed
+1943
-1939
No files matched your search
@@ -216,9 +216,9 @@ void PoolGroup<T>::DespawnObject(ActivePoolData& spawns, uint32 guid)
|
||||
template<>
|
||||
void PoolGroup<Creature>::Despawn1Object(uint32 guid)
|
||||
{
|
||||
if (CreatureData const* data = sObjectMgr.GetCreatureData(guid))
|
||||
if (CreatureData const* data = sObjectMgr->GetCreatureData(guid))
|
||||
{
|
||||
sObjectMgr.RemoveCreatureFromGrid(guid, data);
|
||||
sObjectMgr->RemoveCreatureFromGrid(guid, data);
|
||||
|
||||
if (Creature* pCreature = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT), (Creature*)NULL))
|
||||
pCreature->AddObjectToRemoveList();
|
||||
@@ -229,9 +229,9 @@ void PoolGroup<Creature>::Despawn1Object(uint32 guid)
|
||||
template<>
|
||||
void PoolGroup<GameObject>::Despawn1Object(uint32 guid)
|
||||
{
|
||||
if (GameObjectData const* data = sObjectMgr.GetGOData(guid))
|
||||
if (GameObjectData const* data = sObjectMgr->GetGOData(guid))
|
||||
{
|
||||
sObjectMgr.RemoveGameobjectFromGrid(guid, data);
|
||||
sObjectMgr->RemoveGameobjectFromGrid(guid, data);
|
||||
|
||||
if (GameObject* pGameobject = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(guid, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL))
|
||||
pGameobject->AddObjectToRemoveList();
|
||||
@@ -242,7 +242,7 @@ void PoolGroup<GameObject>::Despawn1Object(uint32 guid)
|
||||
template<>
|
||||
void PoolGroup<Pool>::Despawn1Object(uint32 child_pool_id)
|
||||
{
|
||||
sPoolMgr.DespawnPool(child_pool_id);
|
||||
sPoolMgr->DespawnPool(child_pool_id);
|
||||
}
|
||||
|
||||
// Same on one quest
|
||||
@@ -250,8 +250,8 @@ template<>
|
||||
void PoolGroup<Quest>::Despawn1Object(uint32 quest_id)
|
||||
{
|
||||
// Creatures
|
||||
QuestRelations* questMap = sObjectMgr.GetCreatureQuestRelationMap();
|
||||
PooledQuestRelationBoundsNC qr = sPoolMgr.mQuestCreatureRelation.equal_range(quest_id);
|
||||
QuestRelations* questMap = sObjectMgr->GetCreatureQuestRelationMap();
|
||||
PooledQuestRelationBoundsNC qr = sPoolMgr->mQuestCreatureRelation.equal_range(quest_id);
|
||||
for (PooledQuestRelation::iterator itr = qr.first; itr != qr.second; ++itr)
|
||||
{
|
||||
QuestRelations::iterator qitr = questMap->find(itr->second);
|
||||
@@ -269,8 +269,8 @@ void PoolGroup<Quest>::Despawn1Object(uint32 quest_id)
|
||||
}
|
||||
|
||||
// Gameobjects
|
||||
questMap = sObjectMgr.GetGOQuestRelationMap();
|
||||
qr = sPoolMgr.mQuestGORelation.equal_range(quest_id);
|
||||
questMap = sObjectMgr->GetGOQuestRelationMap();
|
||||
qr = sPoolMgr->mQuestGORelation.equal_range(quest_id);
|
||||
for (PooledQuestRelation::iterator itr = qr.first; itr != qr.second; ++itr)
|
||||
{
|
||||
QuestRelations::iterator qitr = questMap->find(itr->second);
|
||||
@@ -354,12 +354,12 @@ void PoolGroup<T>::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32 trig
|
||||
template <>
|
||||
void PoolGroup<Creature>::Spawn1Object(PoolObject* obj)
|
||||
{
|
||||
if (CreatureData const* data = sObjectMgr.GetCreatureData(obj->guid))
|
||||
if (CreatureData const* data = sObjectMgr->GetCreatureData(obj->guid))
|
||||
{
|
||||
sObjectMgr.AddCreatureToGrid(obj->guid, data);
|
||||
sObjectMgr->AddCreatureToGrid(obj->guid, data);
|
||||
|
||||
// Spawn if necessary (loaded grids only)
|
||||
Map* map = const_cast<Map*>(sMapMgr.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))
|
||||
{
|
||||
@@ -380,12 +380,12 @@ void PoolGroup<Creature>::Spawn1Object(PoolObject* obj)
|
||||
template <>
|
||||
void PoolGroup<GameObject>::Spawn1Object(PoolObject* obj)
|
||||
{
|
||||
if (GameObjectData const* data = sObjectMgr.GetGOData(obj->guid))
|
||||
if (GameObjectData const* data = sObjectMgr->GetGOData(obj->guid))
|
||||
{
|
||||
sObjectMgr.AddGameobjectToGrid(obj->guid, data);
|
||||
sObjectMgr->AddGameobjectToGrid(obj->guid, data);
|
||||
// Spawn if necessary (loaded grids only)
|
||||
// this base map checked as non-instanced and then only existed
|
||||
Map* map = const_cast<Map*>(sMapMgr.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))
|
||||
{
|
||||
@@ -409,7 +409,7 @@ void PoolGroup<GameObject>::Spawn1Object(PoolObject* obj)
|
||||
template <>
|
||||
void PoolGroup<Pool>::Spawn1Object(PoolObject* obj)
|
||||
{
|
||||
sPoolMgr.SpawnPool(obj->guid);
|
||||
sPoolMgr->SpawnPool(obj->guid);
|
||||
}
|
||||
|
||||
// Same for 1 quest
|
||||
@@ -417,8 +417,8 @@ template<>
|
||||
void PoolGroup<Quest>::Spawn1Object(PoolObject* obj)
|
||||
{
|
||||
// Creatures
|
||||
QuestRelations* questMap = sObjectMgr.GetCreatureQuestRelationMap();
|
||||
PooledQuestRelationBoundsNC qr = sPoolMgr.mQuestCreatureRelation.equal_range(obj->guid);
|
||||
QuestRelations* questMap = sObjectMgr->GetCreatureQuestRelationMap();
|
||||
PooledQuestRelationBoundsNC qr = sPoolMgr->mQuestCreatureRelation.equal_range(obj->guid);
|
||||
for (PooledQuestRelation::iterator itr = qr.first; itr != qr.second; ++itr)
|
||||
{
|
||||
sLog.outDebug("PoolGroup<Quest>: Adding quest %u to creature %u", itr->first, itr->second);
|
||||
@@ -426,8 +426,8 @@ void PoolGroup<Quest>::Spawn1Object(PoolObject* obj)
|
||||
}
|
||||
|
||||
// Gameobjects
|
||||
questMap = sObjectMgr.GetGOQuestRelationMap();
|
||||
qr = sPoolMgr.mQuestGORelation.equal_range(obj->guid);
|
||||
questMap = sObjectMgr->GetGOQuestRelationMap();
|
||||
qr = sPoolMgr->mQuestGORelation.equal_range(obj->guid);
|
||||
for (PooledQuestRelation::iterator itr = qr.first; itr != qr.second; ++itr)
|
||||
{
|
||||
sLog.outDebug("PoolGroup<Quest>: Adding quest %u to GO %u", itr->first, itr->second);
|
||||
@@ -500,14 +500,14 @@ void PoolGroup<Quest>::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32
|
||||
|
||||
// if we are here it means the pool is initialized at startup and did not have previous saved state
|
||||
if (!triggerFrom)
|
||||
sPoolMgr.SaveQuestsToDB();
|
||||
sPoolMgr->SaveQuestsToDB();
|
||||
}
|
||||
|
||||
// Method that does the respawn job on the specified creature
|
||||
template <>
|
||||
void PoolGroup<Creature>::ReSpawn1Object(PoolObject* obj)
|
||||
{
|
||||
if (CreatureData const* data = sObjectMgr.GetCreatureData(obj->guid))
|
||||
if (CreatureData const* data = sObjectMgr->GetCreatureData(obj->guid))
|
||||
if (Creature* pCreature = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(obj->guid, data->id, HIGHGUID_UNIT), (Creature*)NULL))
|
||||
pCreature->GetMap()->Add(pCreature);
|
||||
}
|
||||
@@ -516,7 +516,7 @@ void PoolGroup<Creature>::ReSpawn1Object(PoolObject* obj)
|
||||
template <>
|
||||
void PoolGroup<GameObject>::ReSpawn1Object(PoolObject* obj)
|
||||
{
|
||||
if (GameObjectData const* data = sObjectMgr.GetGOData(obj->guid))
|
||||
if (GameObjectData const* data = sObjectMgr->GetGOData(obj->guid))
|
||||
if (GameObject* pGameobject = sObjectAccessor.GetObjectInWorld(MAKE_NEW_GUID(obj->guid, data->id, HIGHGUID_GAMEOBJECT), (GameObject*)NULL))
|
||||
pGameobject->GetMap()->Add(pGameobject);
|
||||
}
|
||||
@@ -614,7 +614,7 @@ void PoolMgr::LoadFromDB()
|
||||
uint32 pool_id = fields[1].GetUInt32();
|
||||
float chance = fields[2].GetFloat();
|
||||
|
||||
CreatureData const* data = sObjectMgr.GetCreatureData(guid);
|
||||
CreatureData const* data = sObjectMgr->GetCreatureData(guid);
|
||||
if (!data)
|
||||
{
|
||||
sLog.outErrorDb("`pool_creature` has a non existing creature spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id);
|
||||
@@ -674,7 +674,7 @@ void PoolMgr::LoadFromDB()
|
||||
uint32 pool_id = fields[1].GetUInt32();
|
||||
float chance = fields[2].GetFloat();
|
||||
|
||||
GameObjectData const* data = sObjectMgr.GetGOData(guid);
|
||||
GameObjectData const* data = sObjectMgr->GetGOData(guid);
|
||||
if (!data)
|
||||
{
|
||||
sLog.outErrorDb("`pool_gameobject` has a non existing gameobject spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id);
|
||||
@@ -842,7 +842,7 @@ void PoolMgr::LoadQuestPools()
|
||||
uint32 entry = fields[0].GetUInt32();
|
||||
uint32 pool_id = fields[1].GetUInt32();
|
||||
|
||||
Quest const* pQuest = sObjectMgr.GetQuestTemplate(entry);
|
||||
Quest const* pQuest = sObjectMgr->GetQuestTemplate(entry);
|
||||
if (!pQuest)
|
||||
{
|
||||
sLog.outErrorDb("`pool_quest` has a non existing quest template (Entry: %u) defined for pool id (%u), skipped.", entry, pool_id);
|
||||
@@ -966,7 +966,7 @@ void PoolMgr::ChangeDailyQuests()
|
||||
{
|
||||
for (PoolGroupQuestMap::iterator itr = mPoolQuestGroups.begin(); itr != mPoolQuestGroups.end(); ++itr)
|
||||
{
|
||||
if (Quest const* pQuest = sObjectMgr.GetQuestTemplate(itr->GetFirstEqualChancedObjectId()))
|
||||
if (Quest const* pQuest = sObjectMgr->GetQuestTemplate(itr->GetFirstEqualChancedObjectId()))
|
||||
{
|
||||
if (pQuest->IsWeekly())
|
||||
continue;
|
||||
@@ -982,7 +982,7 @@ void PoolMgr::ChangeWeeklyQuests()
|
||||
{
|
||||
for (PoolGroupQuestMap::iterator itr = mPoolQuestGroups.begin(); itr != mPoolQuestGroups.end(); ++itr)
|
||||
{
|
||||
if (Quest const* pQuest = sObjectMgr.GetQuestTemplate(itr->GetFirstEqualChancedObjectId()))
|
||||
if (Quest const* pQuest = sObjectMgr->GetQuestTemplate(itr->GetFirstEqualChancedObjectId()))
|
||||
{
|
||||
if (pQuest->IsDaily())
|
||||
continue;
|
||||
|
||||
Reference in new issue
Block a user