aboutsummaryrefslogtreecommitdiff
path: root/src/game/Level2.cpp
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/Level2.cpp
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/Level2.cpp')
-rw-r--r--src/game/Level2.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
index dc9d84bf4c8..106c573dc35 100644
--- a/src/game/Level2.cpp
+++ b/src/game/Level2.cpp
@@ -42,7 +42,7 @@
#include "GlobalEvents.h"
#include "OutdoorPvPWG.h"
#include "OutdoorPvPMgr.h"
-
+#include "TimeMgr.h"
#include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand
#include "CreatureGroups.h"
@@ -79,7 +79,7 @@ bool ChatHandler::HandleMuteCommand(const char* args)
if(HasLowerSecurity (target,target_guid,true))
return false;
- time_t mutetime = time(NULL) + notspeaktime*60;
+ time_t mutetime = sGameTime.GetGameTime() + notspeaktime*60;
if (target)
target->GetSession()->m_muteTime = mutetime;
@@ -536,7 +536,7 @@ bool ChatHandler::HandleGameObjectTargetCommand(const char* args)
if(target)
{
- int32 curRespawnDelay = target->GetRespawnTimeEx()-time(NULL);
+ int32 curRespawnDelay = target->GetRespawnTimeEx()-sGameTime.GetGameTime();
if(curRespawnDelay < 0)
curRespawnDelay = 0;
@@ -3502,8 +3502,8 @@ bool ChatHandler::HandleEventInfoCommand(const char* args)
std::string endTimeStr = TimeToTimestampStr(eventData.end);
uint32 delay = gameeventmgr.NextCheck(event_id);
- time_t nextTime = time(NULL)+delay;
- std::string nextStr = nextTime >= eventData.start && nextTime < eventData.end ? TimeToTimestampStr(time(NULL)+delay) : "-";
+ time_t nextTime = sGameTime.GetGameTime()+delay;
+ std::string nextStr = nextTime >= eventData.start && nextTime < eventData.end ? TimeToTimestampStr(sGameTime.GetGameTime()+delay) : "-";
std::string occurenceStr = secsToTimeString(eventData.occurence * MINUTE);
std::string lengthStr = secsToTimeString(eventData.length * MINUTE);