Core: Get rid of dirty operator workaround for ACE_Singleton class implementation
--HG-- branch : trunk
This commit is contained in:
@@ -537,7 +537,7 @@ struct SQLCreatureLoader : public SQLStorageLoaderBase<SQLCreatureLoader>
|
||||
template<class D>
|
||||
void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
|
||||
{
|
||||
dst = D(sObjectMgr.GetScriptId(src));
|
||||
dst = D(sObjectMgr->GetScriptId(src));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1307,7 +1307,7 @@ void ObjectMgr::LoadCreatures()
|
||||
spawnMasks[i] |= (1 << k);
|
||||
|
||||
//TODO: remove this
|
||||
//sGameEventMgr.mGameEventCreatureGuids.resize(52*2-1);
|
||||
//sGameEventMgr->mGameEventCreatureGuids.resize(52*2-1);
|
||||
|
||||
|
||||
do
|
||||
@@ -1437,14 +1437,14 @@ void ObjectMgr::LoadCreatures()
|
||||
/*if (entry == 30739 || entry == 30740)
|
||||
{
|
||||
gameEvent = 51;
|
||||
uint32 guid2 = sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT);
|
||||
uint32 guid2 = sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT);
|
||||
CreatureData& data2 = mCreatureDataMap[guid2];
|
||||
data2 = data;
|
||||
// data2.id = (entry == 32307 ? 32308 : 32307);
|
||||
data2.id = (entry == 30739 ? 30740 : 30739);
|
||||
data2.displayid = 0;
|
||||
sGameEventMgr.mGameEventCreatureGuids[51+51].push_back(guid);
|
||||
sGameEventMgr.mGameEventCreatureGuids[51+50].push_back(guid2);
|
||||
sGameEventMgr->mGameEventCreatureGuids[51+51].push_back(guid);
|
||||
sGameEventMgr->mGameEventCreatureGuids[51+50].push_back(guid2);
|
||||
}*/
|
||||
|
||||
if (gameEvent == 0 && PoolId == 0) // if not this is to be managed by GameEvent System or Pool system
|
||||
@@ -1496,7 +1496,7 @@ uint32 ObjectMgr::AddGOData(uint32 entry, uint32 mapId, float x, float y, float
|
||||
if (!goinfo)
|
||||
return 0;
|
||||
|
||||
Map* map = const_cast<Map*>(sMapMgr.CreateBaseMap(mapId));
|
||||
Map* map = const_cast<Map*>(sMapMgr->CreateBaseMap(mapId));
|
||||
if (!map)
|
||||
return 0;
|
||||
|
||||
@@ -1557,7 +1557,7 @@ bool ObjectMgr::MoveCreData(uint32 guid, uint32 mapId, Position pos)
|
||||
AddCreatureToGrid(guid, &data);
|
||||
|
||||
// Spawn if necessary (loaded grids only)
|
||||
if (Map* map = const_cast<Map*>(sMapMgr.CreateBaseMap(mapId)))
|
||||
if (Map* map = const_cast<Map*>(sMapMgr->CreateBaseMap(mapId)))
|
||||
{
|
||||
// We use spawn coords to spawn
|
||||
if (!map->Instanceable() && map->IsLoaded(data.posX, data.posY))
|
||||
@@ -1582,7 +1582,7 @@ uint32 ObjectMgr::AddCreData(uint32 entry, uint32 /*team*/, uint32 mapId, float
|
||||
return 0;
|
||||
|
||||
uint32 level = cInfo->minlevel == cInfo->maxlevel ? cInfo->minlevel : urand(cInfo->minlevel, cInfo->maxlevel); // Only used for extracting creature base stats
|
||||
CreatureBaseStats const* stats = sObjectMgr.GetCreatureBaseStats(level, cInfo->unit_class);
|
||||
CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(level, cInfo->unit_class);
|
||||
|
||||
uint32 guid = GenerateLowGuid(HIGHGUID_UNIT);
|
||||
CreatureData& data = NewOrExistCreatureData(guid);
|
||||
@@ -1612,7 +1612,7 @@ uint32 ObjectMgr::AddCreData(uint32 entry, uint32 /*team*/, uint32 mapId, float
|
||||
AddCreatureToGrid(guid, &data);
|
||||
|
||||
// Spawn if necessary (loaded grids only)
|
||||
if (Map* map = const_cast<Map*>(sMapMgr.CreateBaseMap(mapId)))
|
||||
if (Map* map = const_cast<Map*>(sMapMgr->CreateBaseMap(mapId)))
|
||||
{
|
||||
// We use spawn coords to spawn
|
||||
if (!map->Instanceable() && !map->IsRemovalGrid(x, y))
|
||||
@@ -2005,7 +2005,7 @@ struct SQLItemLoader : public SQLStorageLoaderBase<SQLItemLoader>
|
||||
template<class D>
|
||||
void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
|
||||
{
|
||||
dst = D(sObjectMgr.GetScriptId(src));
|
||||
dst = D(sObjectMgr->GetScriptId(src));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2270,7 +2270,7 @@ void ObjectMgr::LoadItemPrototypes()
|
||||
else if (proto->Spells[1].SpellId != -1)
|
||||
{
|
||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(proto->Spells[1].SpellId);
|
||||
if (!spellInfo && !sDisableMgr.IsDisabledFor(DISABLE_TYPE_SPELL, proto->Spells[1].SpellId, NULL))
|
||||
if (!spellInfo && !sDisableMgr->IsDisabledFor(DISABLE_TYPE_SPELL, proto->Spells[1].SpellId, NULL))
|
||||
{
|
||||
sLog.outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)",i,1+1,proto->Spells[1].SpellId);
|
||||
const_cast<ItemPrototype*>(proto)->Spells[0].SpellId = 0;
|
||||
@@ -2318,7 +2318,7 @@ void ObjectMgr::LoadItemPrototypes()
|
||||
if (proto->Spells[j].SpellId && proto->Spells[j].SpellId != -1)
|
||||
{
|
||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(proto->Spells[j].SpellId);
|
||||
if (!spellInfo && !sDisableMgr.IsDisabledFor(DISABLE_TYPE_SPELL, proto->Spells[j].SpellId, NULL))
|
||||
if (!spellInfo && !sDisableMgr->IsDisabledFor(DISABLE_TYPE_SPELL, proto->Spells[j].SpellId, NULL))
|
||||
{
|
||||
sLog.outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)",i,j+1,proto->Spells[j].SpellId);
|
||||
const_cast<ItemPrototype*>(proto)->Spells[j].SpellId = 0;
|
||||
@@ -3938,7 +3938,7 @@ void ObjectMgr::LoadGroups()
|
||||
diff = 0; // default for both difficaly types
|
||||
}
|
||||
|
||||
InstanceSave *save = sInstanceSaveMgr.AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), Difficulty(diff), time_t(fields[5].GetUInt64()), fields[6].GetBool(), true);
|
||||
InstanceSave *save = sInstanceSaveMgr->AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), Difficulty(diff), time_t(fields[5].GetUInt64()), fields[6].GetBool(), true);
|
||||
group->BindToInstance(save, fields[3].GetBool(), true);
|
||||
++count;
|
||||
}
|
||||
@@ -4021,7 +4021,7 @@ void ObjectMgr::LoadQuests()
|
||||
for (QuestMap::iterator iter = mQuestTemplates.begin(); iter != mQuestTemplates.end(); ++iter)
|
||||
{
|
||||
// skip post-loading checks for disabled quests
|
||||
if (sDisableMgr.IsDisabledFor(DISABLE_TYPE_QUEST, iter->first, NULL))
|
||||
if (sDisableMgr->IsDisabledFor(DISABLE_TYPE_QUEST, iter->first, NULL))
|
||||
continue;
|
||||
|
||||
Quest * qinfo = iter->second;
|
||||
@@ -5212,7 +5212,7 @@ void ObjectMgr::LoadSpellScriptNames()
|
||||
|
||||
if (allRanks)
|
||||
{
|
||||
if (sSpellMgr.GetFirstSpellInChain(spellId) != uint32(spellId))
|
||||
if (sSpellMgr->GetFirstSpellInChain(spellId) != uint32(spellId))
|
||||
{
|
||||
sLog.outErrorDb("Scriptname:`%s` spell (spell_id:%d) is not first rank of spell.",scriptName,fields[0].GetInt32());
|
||||
continue;
|
||||
@@ -5220,7 +5220,7 @@ void ObjectMgr::LoadSpellScriptNames()
|
||||
while(spellId)
|
||||
{
|
||||
mSpellScripts.insert(SpellScriptsMap::value_type(spellId, GetScriptId(scriptName)));
|
||||
spellId = sSpellMgr.GetNextSpellInChain(spellId);
|
||||
spellId = sSpellMgr->GetNextSpellInChain(spellId);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -5250,7 +5250,7 @@ void ObjectMgr::ValidateSpellScripts()
|
||||
{
|
||||
SpellEntry const * spellEntry = sSpellStore.LookupEntry(itr->first);
|
||||
std::vector<std::pair<SpellScriptLoader *, SpellScriptsMap::iterator> > SpellScriptLoaders;
|
||||
sScriptMgr.CreateSpellScriptLoaders(itr->first, SpellScriptLoaders);
|
||||
sScriptMgr->CreateSpellScriptLoaders(itr->first, SpellScriptLoaders);
|
||||
itr = mSpellScripts.upper_bound(itr->first);
|
||||
|
||||
|
||||
@@ -5383,7 +5383,7 @@ struct SQLInstanceLoader : public SQLStorageLoaderBase<SQLInstanceLoader>
|
||||
template<class D>
|
||||
void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
|
||||
{
|
||||
dst = D(sObjectMgr.GetScriptId(src));
|
||||
dst = D(sObjectMgr->GetScriptId(src));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -5883,7 +5883,7 @@ uint32 ObjectMgr::GetTaxiMountDisplayId(uint32 id, uint32 team, bool allowed_alt
|
||||
}
|
||||
}
|
||||
|
||||
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(mount_id);
|
||||
CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(mount_id);
|
||||
if (minfo)
|
||||
mount_id = minfo->modelid;
|
||||
|
||||
@@ -5954,7 +5954,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 = sMapMgr.GetZoneId(MapId,x,y,z);
|
||||
uint32 zoneId = sMapMgr->GetZoneId(MapId,x,y,z);
|
||||
|
||||
if (!zoneId)
|
||||
{
|
||||
@@ -6598,7 +6598,7 @@ struct SQLGameObjectLoader : public SQLStorageLoaderBase<SQLGameObjectLoader>
|
||||
template<class D>
|
||||
void convert_from_str(uint32 /*field_pos*/, char *src, D &dst)
|
||||
{
|
||||
dst = D(sObjectMgr.GetScriptId(src));
|
||||
dst = D(sObjectMgr->GetScriptId(src));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7580,7 +7580,7 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string table,
|
||||
}
|
||||
|
||||
|
||||
PooledQuestRelation* poolRelationMap = go ? &sPoolMgr.mQuestGORelation : &sPoolMgr.mQuestCreatureRelation;
|
||||
PooledQuestRelation* poolRelationMap = go ? &sPoolMgr->mQuestGORelation : &sPoolMgr->mQuestCreatureRelation;
|
||||
if (starter)
|
||||
poolRelationMap->clear();
|
||||
|
||||
@@ -8926,7 +8926,7 @@ void ObjectMgr::LoadDbScriptStrings()
|
||||
// Functions for scripting access
|
||||
uint32 GetAreaTriggerScriptId(uint32 trigger_id)
|
||||
{
|
||||
return sObjectMgr.GetAreaTriggerScriptId(trigger_id);
|
||||
return sObjectMgr->GetAreaTriggerScriptId(trigger_id);
|
||||
}
|
||||
|
||||
bool LoadTrinityStrings(char const* table, int32 start_value, int32 end_value)
|
||||
@@ -8939,17 +8939,17 @@ bool LoadTrinityStrings(char const* table, int32 start_value, int32 end_value)
|
||||
return false;
|
||||
}
|
||||
|
||||
return sObjectMgr.LoadTrinityStrings(table, start_value, end_value);
|
||||
return sObjectMgr->LoadTrinityStrings(table, start_value, end_value);
|
||||
}
|
||||
|
||||
uint32 GetScriptId(const char *name)
|
||||
{
|
||||
return sObjectMgr.GetScriptId(name);
|
||||
return sObjectMgr->GetScriptId(name);
|
||||
}
|
||||
|
||||
ObjectMgr::ScriptNameMap & GetScriptNames()
|
||||
{
|
||||
return sObjectMgr.GetScriptNames();
|
||||
return sObjectMgr->GetScriptNames();
|
||||
}
|
||||
|
||||
GameObjectInfo const *GetGameObjectInfo(uint32 id)
|
||||
@@ -8969,7 +8969,7 @@ CreatureInfo const* GetCreatureTemplateStore(uint32 entry)
|
||||
|
||||
Quest const* GetQuestTemplateStore(uint32 entry)
|
||||
{
|
||||
return sObjectMgr.GetQuestTemplate(entry);
|
||||
return sObjectMgr->GetQuestTemplate(entry);
|
||||
}
|
||||
|
||||
CreatureBaseStats const* ObjectMgr::GetCreatureBaseStats(uint8 level, uint8 unitClass)
|
||||
|
||||
Reference in New Issue
Block a user