* Some singleton renames for consistency:
accmgr -> AccountMgr objmgr -> ObjectMgr auctionmgr -> sAuctionMgr spellmgr -> sSpellMgr CreatureEAI_Mgr -> sEventAIMgr achievementmgr -> sAchievementMgr gameeventmgr -> sGameEventMgr sInstanceSaveManager -> sInstanceSaveMgr poolhandler -> sPoolMgr --HG-- branch : trunk
This commit is contained in:
@@ -152,7 +152,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa
|
||||
|
||||
SetPhaseMask(phaseMask,false);
|
||||
|
||||
GameObjectInfo const* goinfo = objmgr.GetGameObjectInfo(name_id);
|
||||
GameObjectInfo const* goinfo = sObjectMgr.GetGameObjectInfo(name_id);
|
||||
if (!goinfo)
|
||||
{
|
||||
sLog.outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f) ang: %f rotation0: %f rotation1: %f rotation2: %f rotation3: %f",guidlow, name_id, map->GetId(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3);
|
||||
@@ -317,9 +317,9 @@ void GameObject::Update(uint32 diff)
|
||||
return;
|
||||
}
|
||||
// respawn timer
|
||||
uint16 poolid = GetDBTableGUIDLow() ? poolhandler.IsPartOfAPool<GameObject>(GetDBTableGUIDLow()) : 0;
|
||||
uint16 poolid = GetDBTableGUIDLow() ? sPoolMgr.IsPartOfAPool<GameObject>(GetDBTableGUIDLow()) : 0;
|
||||
if (poolid)
|
||||
poolhandler.UpdatePool<GameObject>(poolid, GetDBTableGUIDLow());
|
||||
sPoolMgr.UpdatePool<GameObject>(poolid, GetDBTableGUIDLow());
|
||||
else
|
||||
GetMap()->Add(this);
|
||||
break;
|
||||
@@ -444,7 +444,7 @@ void GameObject::Update(uint32 diff)
|
||||
{
|
||||
if (m_groupLootTimer <= diff)
|
||||
{
|
||||
Group* group = objmgr.GetGroupByGUID(lootingGroupLowGUID);
|
||||
Group* group = sObjectMgr.GetGroupByGUID(lootingGroupLowGUID);
|
||||
if (group)
|
||||
group->EndRoll(&loot);
|
||||
m_groupLootTimer = 0;
|
||||
@@ -559,9 +559,9 @@ void GameObject::Delete()
|
||||
SetGoState(GO_STATE_READY);
|
||||
SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags);
|
||||
|
||||
uint16 poolid = GetDBTableGUIDLow() ? poolhandler.IsPartOfAPool<GameObject>(GetDBTableGUIDLow()) : 0;
|
||||
uint16 poolid = GetDBTableGUIDLow() ? sPoolMgr.IsPartOfAPool<GameObject>(GetDBTableGUIDLow()) : 0;
|
||||
if (poolid)
|
||||
poolhandler.UpdatePool<GameObject>(poolid, GetDBTableGUIDLow());
|
||||
sPoolMgr.UpdatePool<GameObject>(poolid, GetDBTableGUIDLow());
|
||||
else
|
||||
AddObjectToRemoveList();
|
||||
}
|
||||
@@ -583,7 +583,7 @@ void GameObject::SaveToDB()
|
||||
{
|
||||
// this should only be used when the gameobject has already been loaded
|
||||
// preferably after adding to map, because mapid may not be valid otherwise
|
||||
GameObjectData const *data = objmgr.GetGOData(m_DBTableGuid);
|
||||
GameObjectData const *data = sObjectMgr.GetGOData(m_DBTableGuid);
|
||||
if (!data)
|
||||
{
|
||||
sLog.outError("GameObject::SaveToDB failed, cannot get gameobject data!");
|
||||
@@ -603,7 +603,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
||||
if (!m_DBTableGuid)
|
||||
m_DBTableGuid = GetGUIDLow();
|
||||
// update in loaded data (changing data only in this place)
|
||||
GameObjectData& data = objmgr.NewGOData(m_DBTableGuid);
|
||||
GameObjectData& data = sObjectMgr.NewGOData(m_DBTableGuid);
|
||||
|
||||
// data->guid = guid don't must be update at save
|
||||
data.id = GetEntry();
|
||||
@@ -651,7 +651,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
|
||||
|
||||
bool GameObject::LoadFromDB(uint32 guid, Map *map)
|
||||
{
|
||||
GameObjectData const* data = objmgr.GetGOData(guid);
|
||||
GameObjectData const* data = sObjectMgr.GetGOData(guid);
|
||||
|
||||
if (!data)
|
||||
{
|
||||
@@ -677,7 +677,7 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
|
||||
uint32 artKit = data->artKit;
|
||||
|
||||
m_DBTableGuid = guid;
|
||||
if (map->GetInstanceId() != 0) guid = objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT);
|
||||
if (map->GetInstanceId() != 0) guid = sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT);
|
||||
|
||||
if (!Create(guid,entry, map, phaseMask, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state, artKit))
|
||||
return false;
|
||||
@@ -695,13 +695,13 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
|
||||
else
|
||||
{
|
||||
m_respawnDelayTime = data->spawntimesecs;
|
||||
m_respawnTime = objmgr.GetGORespawnTime(m_DBTableGuid, map->GetInstanceId());
|
||||
m_respawnTime = sObjectMgr.GetGORespawnTime(m_DBTableGuid, map->GetInstanceId());
|
||||
|
||||
// ready to respawn
|
||||
if (m_respawnTime && m_respawnTime <= time(NULL))
|
||||
{
|
||||
m_respawnTime = 0;
|
||||
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -719,8 +719,8 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
|
||||
|
||||
void GameObject::DeleteFromDB()
|
||||
{
|
||||
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
objmgr.DeleteGOData(m_DBTableGuid);
|
||||
sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
sObjectMgr.DeleteGOData(m_DBTableGuid);
|
||||
WorldDatabase.PExecuteLog("DELETE FROM gameobject WHERE guid = '%u'", m_DBTableGuid);
|
||||
WorldDatabase.PExecuteLog("DELETE FROM game_event_gameobject WHERE guid = '%u'", m_DBTableGuid);
|
||||
}
|
||||
@@ -735,7 +735,7 @@ GameObject* GameObject::GetGameObject(WorldObject& object, uint64 guid)
|
||||
/*********************************************************/
|
||||
bool GameObject::hasQuest(uint32 quest_id) const
|
||||
{
|
||||
QuestRelations const& qr = objmgr.mGOQuestRelations;
|
||||
QuestRelations const& qr = sObjectMgr.mGOQuestRelations;
|
||||
for (QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
|
||||
{
|
||||
if (itr->second == quest_id)
|
||||
@@ -746,7 +746,7 @@ bool GameObject::hasQuest(uint32 quest_id) const
|
||||
|
||||
bool GameObject::hasInvolvedQuest(uint32 quest_id) const
|
||||
{
|
||||
QuestRelations const& qr = objmgr.mGOQuestInvolvedRelations;
|
||||
QuestRelations const& qr = sObjectMgr.mGOQuestInvolvedRelations;
|
||||
for (QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
|
||||
{
|
||||
if (itr->second == quest_id)
|
||||
@@ -781,7 +781,7 @@ Unit* GameObject::GetOwner() const
|
||||
void GameObject::SaveRespawnTime()
|
||||
{
|
||||
if (m_goData && m_goData->dbData && m_respawnTime > time(NULL) && m_spawnedByDefault)
|
||||
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime);
|
||||
sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime);
|
||||
}
|
||||
|
||||
bool GameObject::isVisibleForInState(Player const* u, bool inVisibleList) const
|
||||
@@ -841,13 +841,13 @@ void GameObject::Respawn()
|
||||
if (m_spawnedByDefault && m_respawnTime > 0)
|
||||
{
|
||||
m_respawnTime = time(NULL);
|
||||
objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
sObjectMgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0);
|
||||
}
|
||||
}
|
||||
|
||||
bool GameObject::ActivateToQuest(Player *pTarget) const
|
||||
{
|
||||
if (!objmgr.IsGameObjectForQuests(GetEntry()))
|
||||
if (!sObjectMgr.IsGameObjectForQuests(GetEntry()))
|
||||
return false;
|
||||
|
||||
switch (GetGoType())
|
||||
@@ -967,7 +967,7 @@ void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = f
|
||||
void GameObject::SetGoArtKit(uint8 kit)
|
||||
{
|
||||
SetByteValue(GAMEOBJECT_BYTES_1, 2, kit);
|
||||
GameObjectData *data = const_cast<GameObjectData*>(objmgr.GetGOData(m_DBTableGuid));
|
||||
GameObjectData *data = const_cast<GameObjectData*>(sObjectMgr.GetGOData(m_DBTableGuid));
|
||||
if (data)
|
||||
data->artKit = kit;
|
||||
}
|
||||
@@ -981,7 +981,7 @@ void GameObject::SetGoArtKit(uint8 artkit, GameObject *go, uint32 lowguid)
|
||||
data = go->GetGOData();
|
||||
}
|
||||
else if (lowguid)
|
||||
data = objmgr.GetGOData(lowguid);
|
||||
data = sObjectMgr.GetGOData(lowguid);
|
||||
|
||||
if (data)
|
||||
const_cast<GameObjectData*>(data)->artKit = artkit;
|
||||
@@ -1070,7 +1070,7 @@ void GameObject::Use(Unit* user)
|
||||
float y_i = GetPositionY() + relativeDistance * sin(orthogonalOrientation);
|
||||
|
||||
if (itr->second)
|
||||
if (Player* ChairUser = objmgr.GetPlayer(itr->second))
|
||||
if (Player* ChairUser = sObjectMgr.GetPlayer(itr->second))
|
||||
if (ChairUser->IsSitState() && ChairUser->getStandState() != UNIT_STAND_STATE_SIT && ChairUser->GetExactDist2d(x_i, y_i) < 0.1f)
|
||||
continue; // This seat is already occupied by ChairUser. NOTE: Not sure if the ChairUser->getStandState() != UNIT_STAND_STATE_SIT check is required.
|
||||
else
|
||||
@@ -1144,7 +1144,7 @@ void GameObject::Use(Unit* user)
|
||||
}
|
||||
|
||||
// possible quest objective for active quests
|
||||
if (info->goober.questId && objmgr.GetQuestTemplate(info->goober.questId))
|
||||
if (info->goober.questId && sObjectMgr.GetQuestTemplate(info->goober.questId))
|
||||
{
|
||||
//Quest require to be active for GO using
|
||||
if (player->GetQuestStatus(info->goober.questId) != QUEST_STATUS_INCOMPLETE)
|
||||
@@ -1216,9 +1216,9 @@ void GameObject::Use(Unit* user)
|
||||
uint32 zone, subzone;
|
||||
GetZoneAndAreaId(zone,subzone);
|
||||
|
||||
int32 zone_skill = objmgr.GetFishingBaseSkillLevel(subzone);
|
||||
int32 zone_skill = sObjectMgr.GetFishingBaseSkillLevel(subzone);
|
||||
if (!zone_skill)
|
||||
zone_skill = objmgr.GetFishingBaseSkillLevel(zone);
|
||||
zone_skill = sObjectMgr.GetFishingBaseSkillLevel(zone);
|
||||
|
||||
//provide error, no fishable zone or area should be 0
|
||||
if (!zone_skill)
|
||||
@@ -1653,7 +1653,7 @@ void GameObject::EventInform(uint32 eventId)
|
||||
const char* GameObject::GetNameForLocaleIdx(int32 loc_idx) const
|
||||
{
|
||||
if (loc_idx >= 0)
|
||||
if (GameObjectLocale const *cl = objmgr.GetGameObjectLocale(GetEntry()))
|
||||
if (GameObjectLocale const *cl = sObjectMgr.GetGameObjectLocale(GetEntry()))
|
||||
if (cl->Name.size() > loc_idx && !cl->Name[loc_idx].empty())
|
||||
return cl->Name[loc_idx].c_str();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user