[10952] Don't use singleton to access static functions.

This commit is contained in:
VladimirMangos 2011-01-03 14:19:25 +03:00
parent 32649abe6b
commit a0e298179c
9 changed files with 13 additions and 13 deletions

View file

@ -3018,7 +3018,7 @@ bool ChatHandler::ExtractLocationFromLink(char** text, uint32& mapid, float& x,
if (!ExtractUInt32(&idS, id))
return false;
if (sObjectMgr.GetCreatureTemplate(id))
if (ObjectMgr::GetCreatureTemplate(id))
{
FindCreatureData worker(id, m_session ? m_session->GetPlayer() : NULL);
@ -3044,7 +3044,7 @@ bool ChatHandler::ExtractLocationFromLink(char** text, uint32& mapid, float& x,
if (!ExtractUInt32(&idS, id))
return false;
if (sObjectMgr.GetGameObjectInfo(id))
if (ObjectMgr::GetGameObjectInfo(id))
{
FindGOData worker(id, m_session ? m_session->GetPlayer() : NULL);

View file

@ -416,7 +416,7 @@ uint32 Creature::ChooseDisplayId(const CreatureInfo *cinfo, const CreatureData *
{
sLog.outErrorDb("Call customer support, ChooseDisplayId can not select native model for creature entry %u, model from creature entry 1 will be used instead.", cinfo->Entry);
if (const CreatureInfo *creatureDefault = sObjectMgr.GetCreatureTemplate(1))
if (const CreatureInfo *creatureDefault = ObjectMgr::GetCreatureTemplate(1))
display_id = creatureDefault->ModelId[0];
}

View file

@ -401,7 +401,7 @@ void GameEventMgr::LoadFromDB()
newData.equipment_id = 0;
}
if (newData.entry_id && !sObjectMgr.GetCreatureTemplate(newData.entry_id))
if (newData.entry_id && !ObjectMgr::GetCreatureTemplate(newData.entry_id))
{
sLog.outErrorDb("Table `game_event_creature_data` have creature (Guid: %u) with event time entry %u not found in table `creature_template`, set to no 0.", guid, newData.entry_id);
newData.entry_id = 0;

View file

@ -521,7 +521,7 @@ bool ChatHandler::HandleGoCreatureCommand(char* args)
if (!tEntry)
return false;
if (!sObjectMgr.GetCreatureTemplate(tEntry))
if (!ObjectMgr::GetCreatureTemplate(tEntry))
{
SendSysMessage(LANG_COMMAND_GOCREATNOTFOUND);
SetSentErrorMessage(true);
@ -666,7 +666,7 @@ bool ChatHandler::HandleGoObjectCommand(char* args)
if (!tEntry)
return false;
if (!sObjectMgr.GetGameObjectInfo(tEntry))
if (!ObjectMgr::GetGameObjectInfo(tEntry))
{
SendSysMessage(LANG_COMMAND_GOOBJNOTFOUND);
SetSentErrorMessage(true);

View file

@ -983,7 +983,7 @@ uint32 ObjectMgr::GetModelForRace(uint32 sourceModelId, uint32 racemask)
if (itr->second.creature_entry)
{
const CreatureInfo *cInfo = sObjectMgr.GetCreatureTemplate(itr->second.creature_entry);
const CreatureInfo *cInfo = GetCreatureTemplate(itr->second.creature_entry);
modelId = Creature::ChooseDisplayId(cInfo);
}
else

View file

@ -12149,7 +12149,7 @@ void Player::SendEquipError( uint8 msg, Item* pItem, Item *pItem2, uint32 itemid
case EQUIP_ERR_CANT_EQUIP_LEVEL_I:
case EQUIP_ERR_PURCHASE_LEVEL_TOO_LOW:
{
ItemPrototype const* proto = pItem ? pItem->GetProto() : sObjectMgr.GetItemPrototype(itemid);
ItemPrototype const* proto = pItem ? pItem->GetProto() : ObjectMgr::GetItemPrototype(itemid);
data << uint32(proto ? proto->RequiredLevel : 0);
break;
}
@ -12164,7 +12164,7 @@ void Player::SendEquipError( uint8 msg, Item* pItem, Item *pItem2, uint32 itemid
case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_SOCKETED_EXCEEDED_IS:
case EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED_IS:
{
ItemPrototype const* proto = pItem ? pItem->GetProto() : sObjectMgr.GetItemPrototype(itemid);
ItemPrototype const* proto = pItem ? pItem->GetProto() : ObjectMgr::GetItemPrototype(itemid);
data << uint32(proto ? proto->ItemLimitCategory : 0);
break;
}

View file

@ -4118,7 +4118,7 @@ void Spell::EffectSummonType(SpellEffectIndex eff_idx)
else
{
// possible sort totems/guardians only by summon creature type
CreatureInfo const* cInfo = sObjectMgr.GetCreatureTemplate(m_spellInfo->EffectMiscValue[eff_idx]);
CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(m_spellInfo->EffectMiscValue[eff_idx]);
if (!cInfo)
return;

View file

@ -221,7 +221,7 @@ void WaypointManager::Load()
for(std::set<uint32>::const_iterator itr = creatureNoMoveType.begin(); itr != creatureNoMoveType.end(); ++itr)
{
const CreatureData* cData = sObjectMgr.GetCreatureData(*itr);
const CreatureInfo* cInfo = sObjectMgr.GetCreatureTemplate(cData->id);
const CreatureInfo* cInfo = ObjectMgr::GetCreatureTemplate(cData->id);
sLog.outErrorDb("Table creature_movement has waypoint for creature guid %u (entry %u), but MovementType is not WAYPOINT_MOTION_TYPE(2). Creature will not use this path.", *itr, cData->id);
@ -288,7 +288,7 @@ void WaypointManager::Load()
uint32 entry = fields[0].GetUInt32();
uint32 point = fields[1].GetUInt32();
const CreatureInfo* cInfo = sObjectMgr.GetCreatureTemplate(entry);
const CreatureInfo* cInfo = ObjectMgr::GetCreatureTemplate(entry);
if (!cInfo)
{

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10951"
#define REVISION_NR "10952"
#endif // __REVISION_NR_H__