Don't use singleton to access static functions.

* This affects especially ObjectMgr functions:
   - GetCreatureInfo
   - GetGameObjectInfo
   - GetInstanceTemplate
   These are in fact static functions.
This commit is contained in:
XTZGZoReX 2009-11-08 03:33:06 +01:00
parent 34dab079c4
commit 1f23884757
40 changed files with 104 additions and 104 deletions

View file

@ -678,7 +678,7 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
if(item_id==40582)
continue;
ItemPrototype const* iProto = objmgr.GetItemPrototype(item_id);
ItemPrototype const* iProto = ObjectMgr::GetItemPrototype(item_id);
if(!iProto)
{
sLog.outErrorDb("Initial item id %u (race %u class %u) from CharStartOutfit.dbc not listed in `item_template`, ignoring.",item_id,getRace(),getClass());
@ -1498,7 +1498,7 @@ bool Player::BuildEnumData( QueryResult * result, WorldPacket * p_data )
{
uint32 visualbase = PLAYER_VISIBLE_ITEM_1_ENTRYID + (slot * 2);
uint32 item_id = GetUInt32ValueFromArray(data, visualbase);
const ItemPrototype * proto = objmgr.GetItemPrototype(item_id);
const ItemPrototype * proto = ObjectMgr::GetItemPrototype(item_id);
if(!proto)
{
*p_data << uint32(0);
@ -3963,7 +3963,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
uint32 item_guidlow = fields2[1].GetUInt32();
uint32 item_template = fields2[2].GetUInt32();
ItemPrototype const* itemProto = objmgr.GetItemPrototype(item_template);
ItemPrototype const* itemProto = ObjectMgr::GetItemPrototype(item_template);
if(!itemProto)
{
CharacterDatabase.PExecute("DELETE FROM item_instance WHERE guid = '%u'", item_guidlow);
@ -5575,7 +5575,7 @@ ActionButton* Player::addActionButton(uint8 button, uint32 action, uint8 type)
}
break;
case ACTION_BUTTON_ITEM:
if(!objmgr.GetItemPrototype(action))
if(!ObjectMgr::GetItemPrototype(action))
{
sLog.outError( "Action %u not added into button %u for player %s: item not exist", action, button, GetName() );
return NULL;
@ -7278,7 +7278,7 @@ void Player::_ApplyAmmoBonuses()
float currentAmmoDPS;
ItemPrototype const *ammo_proto = objmgr.GetItemPrototype( ammo_id );
ItemPrototype const *ammo_proto = ObjectMgr::GetItemPrototype( ammo_id );
if( !ammo_proto || ammo_proto->Class!=ITEM_CLASS_PROJECTILE || !CheckAmmoCompatibility(ammo_proto))
currentAmmoDPS = 0.0f;
else
@ -8751,7 +8751,7 @@ bool Player::HasItemOrGemWithIdEquipped( uint32 item, uint32 count, uint8 except
}
}
ItemPrototype const *pProto = objmgr.GetItemPrototype(item);
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(item);
if (pProto && pProto->GemProperties)
{
for(int i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i)
@ -8808,7 +8808,7 @@ bool Player::HasItemOrGemWithLimitCategoryEquipped( uint32 limitCategory, uint32
uint8 Player::_CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count ) const
{
ItemPrototype const *pProto = objmgr.GetItemPrototype(entry);
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(entry);
if( !pProto )
{
if(no_space_count)
@ -9072,7 +9072,7 @@ uint8 Player::_CanStoreItem( uint8 bag, uint8 slot, ItemPosCountVec &dest, uint3
{
sLog.outDebug( "STORAGE: CanStoreItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, entry, count);
ItemPrototype const *pProto = objmgr.GetItemPrototype(entry);
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(entry);
if (!pProto)
{
if (no_space_count)
@ -10218,7 +10218,7 @@ uint8 Player::CanUseAmmo( uint32 item ) const
return EQUIP_ERR_YOU_ARE_DEAD;
//if( isStunned() )
// return EQUIP_ERR_YOU_ARE_STUNNED;
ItemPrototype const *pProto = objmgr.GetItemPrototype( item );
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype( item );
if( pProto )
{
if( pProto->InventoryType!= INVTYPE_AMMO )
@ -13728,7 +13728,7 @@ bool Player::HasQuestForItem( uint32 itemid ) const
// examined item is a source item
if (qinfo->ReqSourceId[j] == itemid)
{
ItemPrototype const *pProto = objmgr.GetItemPrototype(itemid);
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(itemid);
// 'unique' item
if (pProto->MaxCount && GetItemCount(itemid,true) < pProto->MaxCount)
@ -14227,7 +14227,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
if(currentBg && currentBg->IsPlayerInBattleGround(GetGUID()))
{
BattleGroundQueueTypeId bgQueueTypeId = sBattleGroundMgr.BGQueueTypeId(currentBg->GetTypeID(), currentBg->GetArenaType());
BattleGroundQueueTypeId bgQueueTypeId = BattleGroundMgr::BGQueueTypeId(currentBg->GetTypeID(), currentBg->GetArenaType());
AddBattleGroundQueueId(bgQueueTypeId);
m_bgData.bgTypeID = currentBg->GetTypeID();
@ -14849,7 +14849,7 @@ void Player::_LoadInventory(QueryResult *result, uint32 timediff)
uint32 item_guid = fields[3].GetUInt32();
uint32 item_id = fields[4].GetUInt32();
ItemPrototype const * proto = objmgr.GetItemPrototype(item_id);
ItemPrototype const * proto = ObjectMgr::GetItemPrototype(item_id);
if(!proto)
{
@ -14992,7 +14992,7 @@ void Player::_LoadMailedItems(Mail *mail)
mail->AddItem(item_guid_low, item_template);
ItemPrototype const *proto = objmgr.GetItemPrototype(item_template);
ItemPrototype const *proto = ObjectMgr::GetItemPrototype(item_template);
if(!proto)
{
@ -17283,7 +17283,7 @@ bool Player::BuyItemFromVendor(uint64 vendorguid, uint32 item, uint8 count, uint
if (!isAlive())
return false;
ItemPrototype const *pProto = objmgr.GetItemPrototype( item );
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype( item );
if (!pProto)
{
SendBuyError( BUY_ERR_CANT_FIND_ITEM, NULL, item, 0);
@ -19916,7 +19916,7 @@ uint8 Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limit_count) c
if(!enchantEntry)
continue;
ItemPrototype const* pGem = objmgr.GetItemPrototype(enchantEntry->GemID);
ItemPrototype const* pGem = ObjectMgr::GetItemPrototype(enchantEntry->GemID);
if(!pGem)
continue;