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
This commit is contained in:
+4
-13
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user