aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/GameObject
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2012-06-07 23:20:57 +0200
committerShauren <shauren.trinity@gmail.com>2012-06-07 23:20:57 +0200
commitc7775c8d72fb8618ad96c243910f923b239ea39b (patch)
tree9ea59ceec04ac86bedfe31655abb04561c312e70 /src/server/game/Entities/GameObject
parent426145373ba93f080c5503054daecd9ec823edcb (diff)
Core/Maps: Moved object respawn time storage from global to map level. This removes unneccessary locking since all objects run within its map's thread.
Diffstat (limited to 'src/server/game/Entities/GameObject')
-rwxr-xr-xsrc/server/game/Entities/GameObject/GameObject.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index 5101d01899d..58440095075 100755
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -338,7 +338,7 @@ void GameObject::Update(uint32 diff)
if (m_respawnTime <= now) // timer expired
{
uint64 dbtableHighGuid = MAKE_NEW_GUID(m_DBTableGuid, GetEntry(), HIGHGUID_GAMEOBJECT);
- time_t linkedRespawntime = sObjectMgr->GetLinkedRespawnTime(dbtableHighGuid, GetMap()->GetInstanceId());
+ time_t linkedRespawntime = GetMap()->GetLinkedRespawnTime(dbtableHighGuid);
if (linkedRespawntime) // Can't respawn, the master is dead
{
uint64 targetGuid = sObjectMgr->GetLinkedRespawnGuid(dbtableHighGuid);
@@ -761,13 +761,13 @@ bool GameObject::LoadGameObjectFromDB(uint32 guid, Map* map, bool addToMap)
else
{
m_respawnDelayTime = data->spawntimesecs;
- m_respawnTime = sObjectMgr->GetGORespawnTime(m_DBTableGuid, map->GetInstanceId());
+ m_respawnTime = GetMap()->GetGORespawnTime(m_DBTableGuid);
// ready to respawn
if (m_respawnTime && m_respawnTime <= time(NULL))
{
m_respawnTime = 0;
- sObjectMgr->RemoveGORespawnTime(m_DBTableGuid, GetInstanceId());
+ GetMap()->RemoveGORespawnTime(m_DBTableGuid);
}
}
}
@@ -788,7 +788,7 @@ bool GameObject::LoadGameObjectFromDB(uint32 guid, Map* map, bool addToMap)
void GameObject::DeleteFromDB()
{
- sObjectMgr->RemoveGORespawnTime(m_DBTableGuid, GetInstanceId());
+ GetMap()->RemoveGORespawnTime(m_DBTableGuid);
sObjectMgr->DeleteGOData(m_DBTableGuid);
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_GAMEOBJECT);
@@ -863,7 +863,7 @@ Unit* GameObject::GetOwner() const
void GameObject::SaveRespawnTime()
{
if (m_goData && m_goData->dbData && m_respawnTime > time(NULL) && m_spawnedByDefault)
- sObjectMgr->SaveGORespawnTime(m_DBTableGuid, GetInstanceId(), m_respawnTime);
+ GetMap()->SaveGORespawnTime(m_DBTableGuid, m_respawnTime);
}
bool GameObject::IsAlwaysVisibleFor(WorldObject const* seer) const
@@ -908,7 +908,7 @@ void GameObject::Respawn()
if (m_spawnedByDefault && m_respawnTime > 0)
{
m_respawnTime = time(NULL);
- sObjectMgr->RemoveGORespawnTime(m_DBTableGuid, GetInstanceId());
+ GetMap()->RemoveGORespawnTime(m_DBTableGuid);
}
}