aboutsummaryrefslogtreecommitdiff
path: root/src/game/GameObject.h
diff options
context:
space:
mode:
authorn0n4m3 <none@none>2009-12-23 08:04:10 +0100
committern0n4m3 <none@none>2009-12-23 08:04:10 +0100
commit3fe0bc52541d8cdf4fa992d9b8b3101cde5848f0 (patch)
treebe5871dc19f69f4555d9ffa7c57e5d964b8e60e0 /src/game/GameObject.h
parent7ea2510980d4b1c96f0341e9c8b9d5784862dc72 (diff)
Replaced time(NULL) on sGameTime.GetGameTime() this is used for better performance.
Original Timer.h divided into 2 parts. Shared project has no need to know about GameTime Singleton. 2 Identical structures with different types are now replaced with one generic templated structure and 2 typedefs. --HG-- branch : trunk
Diffstat (limited to 'src/game/GameObject.h')
-rw-r--r--src/game/GameObject.h17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/game/GameObject.h b/src/game/GameObject.h
index 358af95a9be..b6efbecd690 100644
--- a/src/game/GameObject.h
+++ b/src/game/GameObject.h
@@ -25,6 +25,7 @@
#include "SharedDefines.h"
#include "Object.h"
#include "LootMgr.h"
+#include "TimeMgr.h"
#include "Database/DatabaseEnv.h"
// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform
@@ -640,20 +641,10 @@ class TRINITY_DLL_SPEC GameObject : public WorldObject
uint32 GetSpellId() const { return m_spellId;}
time_t GetRespawnTime() const { return m_respawnTime; }
- time_t GetRespawnTimeEx() const
- {
- time_t now = time(NULL);
- if(m_respawnTime > now)
- return m_respawnTime;
- else
- return now;
- }
+ time_t GetRespawnTimeEx() const;
+
+ void SetRespawnTime(int32 respawn);
- void SetRespawnTime(int32 respawn)
- {
- m_respawnTime = respawn > 0 ? time(NULL) + respawn : 0;
- m_respawnDelayTime = respawn > 0 ? respawn : 0;
- }
void Respawn();
bool isSpawned() const
{