mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[8789] Rename several singleton macros to use more consistent names.
* objmgr -> sObjectMgr * spellmgr -> sSpellMgr * WaypointMgr -> sWaypointMgr * poolhandler -> sPoolMgr * objaccessor -> sObjectAccessor * mapmgr -> sMapMgr * sInstanceSaveManager -> sInstanceSaveMgr * ticketmgr -> sTicketMgr * CreatureEAI_Mgr -> sEventAIMgr * auctionmgr -> sAuctionMgr * achievementmgr -> sAchievementMgr
This commit is contained in:
parent
539072fcbd
commit
0734adb746
84 changed files with 1113 additions and 1113 deletions
|
|
@ -219,14 +219,14 @@ bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data )
|
|||
// known valid are: CLASS_WARRIOR,CLASS_PALADIN,CLASS_ROGUE,CLASS_MAGE
|
||||
SetByteValue(UNIT_FIELD_BYTES_0, 1, uint8(cinfo->unit_class));
|
||||
|
||||
uint32 display_id = objmgr.ChooseDisplayId(team, GetCreatureInfo(), data);
|
||||
uint32 display_id = sObjectMgr.ChooseDisplayId(team, GetCreatureInfo(), data);
|
||||
if (!display_id) // Cancel load if no display id
|
||||
{
|
||||
sLog.outErrorDb("Creature (Entry: %u) has model %u not found in table `creature_model_info`, can't load. ", Entry, display_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id);
|
||||
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
|
||||
if (!minfo) // Cancel load if no model defined
|
||||
{
|
||||
sLog.outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ",Entry);
|
||||
|
|
@ -369,9 +369,9 @@ void Creature::Update(uint32 diff)
|
|||
//Call AI respawn virtual function
|
||||
i_AI->JustRespawned();
|
||||
|
||||
uint16 poolid = poolhandler.IsPartOfAPool(GetGUIDLow(), GetTypeId());
|
||||
uint16 poolid = sPoolMgr.IsPartOfAPool(GetGUIDLow(), GetTypeId());
|
||||
if (poolid)
|
||||
poolhandler.UpdatePool(poolid, GetGUIDLow(), TYPEID_UNIT);
|
||||
sPoolMgr.UpdatePool(poolid, GetGUIDLow(), TYPEID_UNIT);
|
||||
else
|
||||
GetMap()->Add(this);
|
||||
}
|
||||
|
|
@ -398,7 +398,7 @@ void Creature::Update(uint32 diff)
|
|||
}
|
||||
else
|
||||
{
|
||||
Group* group = objmgr.GetGroupByLeader(lootingGroupLeaderGUID);
|
||||
Group* group = sObjectMgr.GetGroupByLeader(lootingGroupLeaderGUID);
|
||||
if (group)
|
||||
group->EndRoll();
|
||||
m_groupLootTimer = 0;
|
||||
|
|
@ -761,7 +761,7 @@ void Creature::prepareGossipMenu( Player *pPlayer,uint32 gossipid )
|
|||
if(gso->Id==1)
|
||||
{
|
||||
uint32 textid=GetNpcTextId();
|
||||
GossipText const* gossiptext=objmgr.GetGossipText(textid);
|
||||
GossipText const* gossiptext=sObjectMgr.GetGossipText(textid);
|
||||
if(!gossiptext)
|
||||
cantalking=false;
|
||||
}
|
||||
|
|
@ -835,7 +835,7 @@ void Creature::prepareGossipMenu( Player *pPlayer,uint32 gossipid )
|
|||
int loc_idx = pPlayer->GetSession()->GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
NpcOptionLocale const *no = objmgr.GetNpcOptionLocale(gso->Id);
|
||||
NpcOptionLocale const *no = sObjectMgr.GetNpcOptionLocale(gso->Id);
|
||||
if (no)
|
||||
{
|
||||
if (no->OptionText.size() > loc_idx && !no->OptionText[loc_idx].empty())
|
||||
|
|
@ -1031,7 +1031,7 @@ uint32 Creature::GetNpcTextId()
|
|||
if (!m_DBTableGuid)
|
||||
return DEFAULT_GOSSIP_MESSAGE;
|
||||
|
||||
if(uint32 pos = objmgr.GetNpcGossip(m_DBTableGuid))
|
||||
if(uint32 pos = sObjectMgr.GetNpcGossip(m_DBTableGuid))
|
||||
return pos;
|
||||
|
||||
return DEFAULT_GOSSIP_MESSAGE;
|
||||
|
|
@ -1054,7 +1054,7 @@ void Creature::LoadGossipOptions()
|
|||
|
||||
uint32 npcflags=GetUInt32Value(UNIT_NPC_FLAGS);
|
||||
|
||||
CacheNpcOptionList const& noList = objmgr.GetNpcOptions ();
|
||||
CacheNpcOptionList const& noList = sObjectMgr.GetNpcOptions ();
|
||||
for (CacheNpcOptionList::const_iterator i = noList.begin (); i != noList.end (); ++i)
|
||||
if(i->NpcFlag & npcflags)
|
||||
addGossipOption(*i);
|
||||
|
|
@ -1116,7 +1116,7 @@ void Creature::SaveToDB()
|
|||
{
|
||||
// this should only be used when the creature has already been loaded
|
||||
// preferably after adding to map, because mapid may not be valid otherwise
|
||||
CreatureData const *data = objmgr.GetCreatureData(m_DBTableGuid);
|
||||
CreatureData const *data = sObjectMgr.GetCreatureData(m_DBTableGuid);
|
||||
if(!data)
|
||||
{
|
||||
sLog.outError("Creature::SaveToDB failed, cannot get creature data!");
|
||||
|
|
@ -1131,7 +1131,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
|||
// update in loaded data
|
||||
if (!m_DBTableGuid)
|
||||
m_DBTableGuid = GetGUIDLow();
|
||||
CreatureData& data = objmgr.NewOrExistCreatureData(m_DBTableGuid);
|
||||
CreatureData& data = sObjectMgr.NewOrExistCreatureData(m_DBTableGuid);
|
||||
|
||||
uint32 displayId = GetNativeDisplayId();
|
||||
|
||||
|
|
@ -1143,22 +1143,22 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
|||
displayId != cinfo->DisplayID_H[0] && displayId != cinfo->DisplayID_H[1])
|
||||
{
|
||||
if (cinfo->DisplayID_A[0])
|
||||
if (CreatureModelInfo const *minfo = objmgr.GetCreatureModelInfo(cinfo->DisplayID_A[0]))
|
||||
if (CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(cinfo->DisplayID_A[0]))
|
||||
if(displayId == minfo->modelid_other_gender)
|
||||
displayId = 0;
|
||||
|
||||
if (displayId && cinfo->DisplayID_A[1])
|
||||
if (CreatureModelInfo const *minfo = objmgr.GetCreatureModelInfo(cinfo->DisplayID_A[1]))
|
||||
if (CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(cinfo->DisplayID_A[1]))
|
||||
if(displayId == minfo->modelid_other_gender)
|
||||
displayId = 0;
|
||||
|
||||
if (displayId && cinfo->DisplayID_H[0])
|
||||
if (CreatureModelInfo const *minfo = objmgr.GetCreatureModelInfo(cinfo->DisplayID_H[0]))
|
||||
if (CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(cinfo->DisplayID_H[0]))
|
||||
if(displayId == minfo->modelid_other_gender)
|
||||
displayId = 0;
|
||||
|
||||
if (displayId && cinfo->DisplayID_H[1])
|
||||
if (CreatureModelInfo const *minfo = objmgr.GetCreatureModelInfo(cinfo->DisplayID_H[1]))
|
||||
if (CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelInfo(cinfo->DisplayID_H[1]))
|
||||
if(displayId == minfo->modelid_other_gender)
|
||||
displayId = 0;
|
||||
}
|
||||
|
|
@ -1345,7 +1345,7 @@ bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 team, const
|
|||
|
||||
bool Creature::LoadFromDB(uint32 guid, Map *map)
|
||||
{
|
||||
CreatureData const* data = objmgr.GetCreatureData(guid);
|
||||
CreatureData const* data = sObjectMgr.GetCreatureData(guid);
|
||||
|
||||
if(!data)
|
||||
{
|
||||
|
|
@ -1364,7 +1364,7 @@ bool Creature::LoadFromDB(uint32 guid, Map *map)
|
|||
return false;
|
||||
}
|
||||
else
|
||||
guid = objmgr.GenerateLowGuid(HIGHGUID_UNIT);
|
||||
guid = sObjectMgr.GenerateLowGuid(HIGHGUID_UNIT);
|
||||
|
||||
uint16 team = 0;
|
||||
if(!Create(guid,map,data->phaseMask,data->id,team,data))
|
||||
|
|
@ -1384,7 +1384,7 @@ bool Creature::LoadFromDB(uint32 guid, Map *map)
|
|||
m_isDeadByDefault = data->is_dead;
|
||||
m_deathState = m_isDeadByDefault ? DEAD : ALIVE;
|
||||
|
||||
m_respawnTime = objmgr.GetCreatureRespawnTime(m_DBTableGuid,GetInstanceId());
|
||||
m_respawnTime = sObjectMgr.GetCreatureRespawnTime(m_DBTableGuid,GetInstanceId());
|
||||
if(m_respawnTime > time(NULL)) // not ready to respawn
|
||||
{
|
||||
m_deathState = DEAD;
|
||||
|
|
@ -1398,7 +1398,7 @@ bool Creature::LoadFromDB(uint32 guid, Map *map)
|
|||
else if(m_respawnTime) // respawn time set but expired
|
||||
{
|
||||
m_respawnTime = 0;
|
||||
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
}
|
||||
|
||||
uint32 curhealth = data->curhealth;
|
||||
|
|
@ -1434,7 +1434,7 @@ void Creature::LoadEquipment(uint32 equip_entry, bool force)
|
|||
return;
|
||||
}
|
||||
|
||||
EquipmentInfo const *einfo = objmgr.GetEquipmentInfo(equip_entry);
|
||||
EquipmentInfo const *einfo = sObjectMgr.GetEquipmentInfo(equip_entry);
|
||||
if (!einfo)
|
||||
return;
|
||||
|
||||
|
|
@ -1445,7 +1445,7 @@ void Creature::LoadEquipment(uint32 equip_entry, bool force)
|
|||
|
||||
bool Creature::hasQuest(uint32 quest_id) const
|
||||
{
|
||||
QuestRelations const& qr = objmgr.mCreatureQuestRelations;
|
||||
QuestRelations const& qr = sObjectMgr.mCreatureQuestRelations;
|
||||
for(QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
|
||||
{
|
||||
if(itr->second==quest_id)
|
||||
|
|
@ -1456,7 +1456,7 @@ bool Creature::hasQuest(uint32 quest_id) const
|
|||
|
||||
bool Creature::hasInvolvedQuest(uint32 quest_id) const
|
||||
{
|
||||
QuestRelations const& qr = objmgr.mCreatureQuestInvolvedRelations;
|
||||
QuestRelations const& qr = sObjectMgr.mCreatureQuestInvolvedRelations;
|
||||
for(QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
|
||||
{
|
||||
if(itr->second==quest_id)
|
||||
|
|
@ -1473,8 +1473,8 @@ void Creature::DeleteFromDB()
|
|||
return;
|
||||
}
|
||||
|
||||
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
objmgr.DeleteCreatureData(m_DBTableGuid);
|
||||
sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
sObjectMgr.DeleteCreatureData(m_DBTableGuid);
|
||||
|
||||
WorldDatabase.BeginTransaction();
|
||||
WorldDatabase.PExecuteLog("DELETE FROM creature WHERE guid = '%u'", m_DBTableGuid);
|
||||
|
|
@ -1607,7 +1607,7 @@ void Creature::Respawn()
|
|||
if(getDeathState()==DEAD)
|
||||
{
|
||||
if (m_DBTableGuid)
|
||||
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
m_respawnTime = time(NULL); // respawn at next tick
|
||||
}
|
||||
}
|
||||
|
|
@ -1902,9 +1902,9 @@ void Creature::SaveRespawnTime()
|
|||
return;
|
||||
|
||||
if(m_respawnTime > time(NULL)) // dead (no corpse)
|
||||
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime);
|
||||
sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime);
|
||||
else if(m_deathTimer > 0) // dead (corpse)
|
||||
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),time(NULL)+m_respawnDelay+m_deathTimer/IN_MILISECONDS);
|
||||
sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),time(NULL)+m_respawnDelay+m_deathTimer/IN_MILISECONDS);
|
||||
}
|
||||
|
||||
bool Creature::IsOutOfThreatArea(Unit* pVictim) const
|
||||
|
|
@ -2139,7 +2139,7 @@ void Creature::GetRespawnCoord( float &x, float &y, float &z, float* ori, float*
|
|||
{
|
||||
if (m_DBTableGuid)
|
||||
{
|
||||
if (CreatureData const* data = objmgr.GetCreatureData(GetDBTableGUIDLow()))
|
||||
if (CreatureData const* data = sObjectMgr.GetCreatureData(GetDBTableGUIDLow()))
|
||||
{
|
||||
x = data->posX;
|
||||
y = data->posY;
|
||||
|
|
@ -2203,7 +2203,7 @@ std::string Creature::GetAIName() const
|
|||
|
||||
std::string Creature::GetScriptName() const
|
||||
{
|
||||
return objmgr.GetScriptName(GetScriptId());
|
||||
return sObjectMgr.GetScriptName(GetScriptId());
|
||||
}
|
||||
|
||||
uint32 Creature::GetScriptId() const
|
||||
|
|
@ -2213,7 +2213,7 @@ uint32 Creature::GetScriptId() const
|
|||
|
||||
VendorItemData const* Creature::GetVendorItems() const
|
||||
{
|
||||
return objmgr.GetNpcVendorItemList(GetEntry());
|
||||
return sObjectMgr.GetNpcVendorItemList(GetEntry());
|
||||
}
|
||||
|
||||
uint32 Creature::GetVendorItemCurrentCount(VendorItem const* vItem)
|
||||
|
|
@ -2290,7 +2290,7 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us
|
|||
|
||||
TrainerSpellData const* Creature::GetTrainerSpells() const
|
||||
{
|
||||
return objmgr.GetNpcTrainerSpells(GetEntry());
|
||||
return sObjectMgr.GetNpcTrainerSpells(GetEntry());
|
||||
}
|
||||
|
||||
// overwrite WorldObject function for proper name localization
|
||||
|
|
@ -2298,7 +2298,7 @@ const char* Creature::GetNameForLocaleIdx(int32 loc_idx) const
|
|||
{
|
||||
if (loc_idx >= 0)
|
||||
{
|
||||
CreatureLocale const *cl = objmgr.GetCreatureLocale(GetEntry());
|
||||
CreatureLocale const *cl = sObjectMgr.GetCreatureLocale(GetEntry());
|
||||
if (cl)
|
||||
{
|
||||
if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue