mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
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:
parent
34dab079c4
commit
1f23884757
40 changed files with 104 additions and 104 deletions
|
|
@ -181,7 +181,7 @@ void Creature::RemoveCorpse()
|
|||
*/
|
||||
bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data )
|
||||
{
|
||||
CreatureInfo const *normalInfo = objmgr.GetCreatureTemplate(Entry);
|
||||
CreatureInfo const *normalInfo = ObjectMgr::GetCreatureTemplate(Entry);
|
||||
if(!normalInfo)
|
||||
{
|
||||
sLog.outErrorDb("Creature::UpdateEntry creature entry %u does not exist.", Entry);
|
||||
|
|
@ -199,7 +199,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data )
|
|||
// we already have valid Map pointer for current creature!
|
||||
if (GetMap()->GetSpawnMode() > diff)
|
||||
{
|
||||
cinfo = objmgr.GetCreatureTemplate(normalInfo->DifficultyEntry[diff]);
|
||||
cinfo = ObjectMgr::GetCreatureTemplate(normalInfo->DifficultyEntry[diff]);
|
||||
if (!cinfo)
|
||||
{
|
||||
// maybe check such things already at startup
|
||||
|
|
@ -1327,7 +1327,7 @@ float Creature::GetSpellDamageMod(int32 Rank)
|
|||
|
||||
bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 team, const CreatureData *data)
|
||||
{
|
||||
CreatureInfo const *cinfo = objmgr.GetCreatureTemplate(Entry);
|
||||
CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(Entry);
|
||||
if(!cinfo)
|
||||
{
|
||||
sLog.outErrorDb("Creature entry %u does not exist.", Entry);
|
||||
|
|
@ -2235,7 +2235,7 @@ uint32 Creature::GetVendorItemCurrentCount(VendorItem const* vItem)
|
|||
|
||||
if( vCount->lastIncrementTime + vItem->incrtime <= ptime )
|
||||
{
|
||||
ItemPrototype const* pProto = objmgr.GetItemPrototype(vItem->item);
|
||||
ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(vItem->item);
|
||||
|
||||
uint32 diff = uint32((ptime - vCount->lastIncrementTime)/vItem->incrtime);
|
||||
if((vCount->count + diff * pProto->BuyCount) >= vItem->maxcount )
|
||||
|
|
@ -2274,7 +2274,7 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us
|
|||
|
||||
if( vCount->lastIncrementTime + vItem->incrtime <= ptime )
|
||||
{
|
||||
ItemPrototype const* pProto = objmgr.GetItemPrototype(vItem->item);
|
||||
ItemPrototype const* pProto = ObjectMgr::GetItemPrototype(vItem->item);
|
||||
|
||||
uint32 diff = uint32((ptime - vCount->lastIncrementTime)/vItem->incrtime);
|
||||
if((vCount->count + diff * pProto->BuyCount) < vItem->maxcount )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue