diff options
| author | n0n4m3 <none@none> | 2009-12-24 10:20:15 +0100 |
|---|---|---|
| committer | n0n4m3 <none@none> | 2009-12-24 10:20:15 +0100 |
| commit | 250a00cc1c91d2df2b6c4f72a2ad322b46fed783 (patch) | |
| tree | eab0216df4c91777747e866ed4525c9fbc7a037f /src/game/GameObject.cpp | |
| parent | acdc4ca15b69c84197f867192328829904646a66 (diff) | |
Temporary revert 6743 commit. I fix this patch across 1-2 days.
--HG--
branch : trunk
Diffstat (limited to 'src/game/GameObject.cpp')
| -rw-r--r-- | src/game/GameObject.cpp | 38 |
1 files changed, 11 insertions, 27 deletions
diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index 1c9e80ee84d..e3794de8a8e 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -39,7 +39,6 @@ #include "Util.h" #include "OutdoorPvPMgr.h" #include "BattleGroundAV.h" -#include "TimeMgr.h" GameObject::GameObject() : WorldObject(), m_goValue(new GameObjectValue) { @@ -226,14 +225,14 @@ void GameObject::Update(uint32 /*p_time*/) // Arming Time for GAMEOBJECT_TYPE_TRAP (6) Unit* owner = GetOwner(); if (owner && owner->isInCombat()) - m_cooldownTime = sGameTime.GetGameTime() + GetGOInfo()->trap.startDelay; + m_cooldownTime = time(NULL) + GetGOInfo()->trap.startDelay; m_lootState = GO_READY; break; } case GAMEOBJECT_TYPE_FISHINGNODE: { // fishing code (bobber ready) - if( sGameTime.GetGameTime() > m_respawnTime - FISHING_BOBBER_READY_TIME ) + if( time(NULL) > m_respawnTime - FISHING_BOBBER_READY_TIME ) { // splash bobber (bobber ready now) Unit* caster = GetOwner(); @@ -265,7 +264,7 @@ void GameObject::Update(uint32 /*p_time*/) { if (m_respawnTime > 0) // timer on { - if (m_respawnTime <= sGameTime.GetGameTime()) // timer expired + if (m_respawnTime <= time(NULL)) // timer expired { m_respawnTime = 0; m_SkillupList.clear(); @@ -317,7 +316,7 @@ void GameObject::Update(uint32 /*p_time*/) GameObjectInfo const* goInfo = GetGOInfo(); if(goInfo->type == GAMEOBJECT_TYPE_TRAP) { - if(m_cooldownTime >= sGameTime.GetGameTime()) + if(m_cooldownTime >= time(NULL)) return; // traps @@ -371,7 +370,7 @@ void GameObject::Update(uint32 /*p_time*/) if(goInfo->trap.spellId) CastSpell(ok, goInfo->trap.spellId); - m_cooldownTime = sGameTime.GetGameTime() + 4; // 4 seconds + m_cooldownTime = time(NULL) + 4; // 4 seconds // count charges //if(goInfo->trap.charges > 0) @@ -407,7 +406,7 @@ void GameObject::Update(uint32 /*p_time*/) { case GAMEOBJECT_TYPE_DOOR: case GAMEOBJECT_TYPE_BUTTON: - if (GetGOInfo()->GetAutoCloseTime() && (m_cooldownTime < sGameTime.GetGameTime())) + if (GetGOInfo()->GetAutoCloseTime() && (m_cooldownTime < time(NULL))) ResetDoorOrButton(); break; default: break; @@ -471,7 +470,7 @@ void GameObject::Update(uint32 /*p_time*/) return; } - m_respawnTime = sGameTime.GetGameTime() + m_respawnDelayTime; + m_respawnTime = time(NULL) + m_respawnDelayTime; // if option not set then object will be saved at grid unload if(sWorld.getConfig(CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY)) @@ -652,7 +651,7 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map) m_respawnTime = objmgr.GetGORespawnTime(m_DBTableGuid, map->GetInstanceId()); // ready to respawn - if(m_respawnTime && m_respawnTime <= sGameTime.GetGameTime()) + if(m_respawnTime && m_respawnTime <= time(NULL)) { m_respawnTime = 0; objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0); @@ -736,7 +735,7 @@ Unit* GameObject::GetOwner(bool inWorld) const void GameObject::SaveRespawnTime() { - if(m_goData && m_goData->dbData && m_respawnTime > sGameTime.GetGameTime() && m_spawnedByDefault) + if(m_goData && m_goData->dbData && m_respawnTime > time(NULL) && m_spawnedByDefault) objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime); } @@ -792,26 +791,11 @@ bool GameObject::canDetectTrap(Player const* u, float distance) const return distance < visibleDistance; } -time_t GameObject::GetRespawnTimeEx() const -{ - time_t now = sGameTime.GetGameTime(); - if(m_respawnTime > now) - return m_respawnTime; - else - return now; -} - -void GameObject::SetRespawnTime(int32 respawn) -{ - m_respawnTime = respawn > 0 ? sGameTime.GetGameTime() + respawn : 0; - m_respawnDelayTime = respawn > 0 ? respawn : 0; -} - void GameObject::Respawn() { if(m_spawnedByDefault && m_respawnTime > 0) { - m_respawnTime = sGameTime.GetGameTime(); + m_respawnTime = time(NULL); objmgr.SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),0); } } @@ -936,7 +920,7 @@ void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = f SwitchDoorOrButton(true,alternative); SetLootState(GO_ACTIVATED); - m_cooldownTime = sGameTime.GetGameTime() + time_to_restore; + m_cooldownTime = time(NULL) + time_to_restore; } void GameObject::SetGoArtKit(uint8 kit) |
