diff options
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/Commands/cs_ban.cpp | 5 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_event.cpp | 5 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_gobject.cpp | 3 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_instance.cpp | 7 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_list.cpp | 5 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_misc.cpp | 6 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_npc.cpp | 3 | ||||
| -rw-r--r-- | src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp | 32 | ||||
| -rw-r--r-- | src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp | 7 | ||||
| -rw-r--r-- | src/server/scripts/Northrend/zone_wintergrasp.cpp | 3 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_item.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_paladin.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/World/npcs_special.cpp | 4 |
13 files changed, 46 insertions, 38 deletions
diff --git a/src/server/scripts/Commands/cs_ban.cpp b/src/server/scripts/Commands/cs_ban.cpp index f63be2f45c8..97b94a9cc7c 100644 --- a/src/server/scripts/Commands/cs_ban.cpp +++ b/src/server/scripts/Commands/cs_ban.cpp @@ -27,6 +27,7 @@ EndScriptData */ #include "CharacterCache.h" #include "Chat.h" #include "DatabaseEnv.h" +#include "GameTime.h" #include "Language.h" #include "ObjectAccessor.h" #include "ObjectMgr.h" @@ -284,7 +285,7 @@ public: time_t unbanDate = time_t(fields[3].GetUInt32()); bool active = false; - if (fields[2].GetBool() && (fields[1].GetUInt64() == uint64(0) || unbanDate >= time(nullptr))) + if (fields[2].GetBool() && (fields[1].GetUInt64() == uint64(0) || unbanDate >= GameTime::GetGameTime())) active = true; bool permanent = (fields[1].GetUInt64() == uint64(0)); std::string banTime = permanent ? handler->GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetUInt64(), true); @@ -340,7 +341,7 @@ public: Field* fields = result->Fetch(); time_t unbanDate = fields[3].GetInt64(); bool active = false; - if (fields[2].GetUInt8() && (!fields[1].GetInt64() || unbanDate >= time(nullptr))) + if (fields[2].GetUInt8() && (!fields[1].GetInt64() || unbanDate >= GameTime::GetGameTime())) active = true; bool permanent = (fields[1].GetInt64() == SI64LIT(0)); std::string banTime = permanent ? handler->GetTrinityString(LANG_BANINFO_INFINITE) : secsToTimeString(fields[1].GetInt64(), true); diff --git a/src/server/scripts/Commands/cs_event.cpp b/src/server/scripts/Commands/cs_event.cpp index 53444d95d8a..20fb1518af4 100644 --- a/src/server/scripts/Commands/cs_event.cpp +++ b/src/server/scripts/Commands/cs_event.cpp @@ -25,6 +25,7 @@ EndScriptData */ #include "ScriptMgr.h" #include "Chat.h" #include "GameEventMgr.h" +#include "GameTime.h" #include "Language.h" #include "Player.h" #include "RBAC.h" @@ -116,8 +117,8 @@ public: std::string endTimeStr = TimeToTimestampStr(eventData.end); uint32 delay = sGameEventMgr->NextCheck(eventId); - time_t nextTime = time(nullptr) + delay; - std::string nextStr = nextTime >= eventData.start && nextTime < eventData.end ? TimeToTimestampStr(time(nullptr) + delay) : "-"; + time_t nextTime = GameTime::GetGameTime() + delay; + std::string nextStr = nextTime >= eventData.start && nextTime < eventData.end ? TimeToTimestampStr(GameTime::GetGameTime() + delay) : "-"; std::string occurenceStr = secsToTimeString(eventData.occurence * MINUTE); std::string lengthStr = secsToTimeString(eventData.length * MINUTE); diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index 0c5643d4a34..49be3e5668e 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -28,6 +28,7 @@ EndScriptData */ #include "DB2Stores.h" #include "GameEventMgr.h" #include "GameObject.h" +#include "GameTime.h" #include "Language.h" #include "Log.h" #include "MapManager.h" @@ -323,7 +324,7 @@ public: if (target) { - int32 curRespawnDelay = int32(target->GetRespawnTimeEx() - time(nullptr)); + int32 curRespawnDelay = int32(target->GetRespawnTimeEx() - GameTime::GetGameTime()); if (curRespawnDelay < 0) curRespawnDelay = 0; diff --git a/src/server/scripts/Commands/cs_instance.cpp b/src/server/scripts/Commands/cs_instance.cpp index 90ed94a4d3b..72dc11eb7c4 100644 --- a/src/server/scripts/Commands/cs_instance.cpp +++ b/src/server/scripts/Commands/cs_instance.cpp @@ -25,6 +25,7 @@ EndScriptData */ #include "ScriptMgr.h" #include "Chat.h" #include "DB2Stores.h" +#include "GameTime.h" #include "Group.h" #include "InstanceSaveMgr.h" #include "InstanceScript.h" @@ -89,7 +90,7 @@ public: for (auto itr = binds->second.begin(); itr != binds->second.end(); ++itr) { InstanceSave* save = itr->second.save; - std::string timeleft = GetTimeString(save->GetResetTime() - time(nullptr)); + std::string timeleft = GetTimeString(save->GetResetTime() - GameTime::GetGameTime()); handler->PSendSysMessage(LANG_COMMAND_LIST_BIND_INFO, itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", itr->second.extendState == EXTEND_STATE_EXPIRED ? "expired" : itr->second.extendState == EXTEND_STATE_EXTENDED ? "yes" : "no", save->GetDifficultyID(), save->CanReset() ? "yes" : "no", timeleft.c_str()); counter++; } @@ -108,7 +109,7 @@ public: for (auto itr = binds->second.begin(); itr != binds->second.end(); ++itr) { InstanceSave* save = itr->second.save; - std::string timeleft = GetTimeString(save->GetResetTime() - time(nullptr)); + std::string timeleft = GetTimeString(save->GetResetTime() - GameTime::GetGameTime()); handler->PSendSysMessage(LANG_COMMAND_LIST_BIND_INFO, itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", "-", save->GetDifficultyID(), save->CanReset() ? "yes" : "no", timeleft.c_str()); counter++; } @@ -154,7 +155,7 @@ public: InstanceSave* save = itr->second.save; if (itr->first != player->GetMapId() && (!MapId || MapId == itr->first) && (diff == -1 || diff == save->GetDifficultyID())) { - std::string timeleft = GetTimeString(save->GetResetTime() - time(nullptr)); + std::string timeleft = GetTimeString(save->GetResetTime() - GameTime::GetGameTime()); handler->PSendSysMessage(LANG_COMMAND_INST_UNBIND_UNBINDING, itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficultyID(), save->CanReset() ? "yes" : "no", timeleft.c_str()); player->UnbindInstance(itr, binds); counter++; diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp index 6c189b4fa19..1141d0d84b8 100644 --- a/src/server/scripts/Commands/cs_list.cpp +++ b/src/server/scripts/Commands/cs_list.cpp @@ -29,6 +29,7 @@ EndScriptData */ #include "DatabaseEnv.h" #include "DB2Stores.h" #include "GameObject.h" +#include "GameTime.h" #include "Language.h" #include "MapManager.h" #include "ObjectAccessor.h" @@ -714,7 +715,7 @@ public: uint32 gridY = ri->gridId / MAX_NUMBER_OF_GRIDS; uint32 gridX = ri->gridId % MAX_NUMBER_OF_GRIDS; - std::string respawnTime = ri->respawnTime > time(NULL) ? secsToTimeString(uint64(ri->respawnTime - time(nullptr)), true) : stringOverdue; + std::string respawnTime = ri->respawnTime > GameTime::GetGameTime() ? secsToTimeString(uint64(ri->respawnTime - GameTime::GetGameTime()), true) : stringOverdue; handler->PSendSysMessage(UI64FMTD " | %u | [%02u,%02u] | %s (%u) | %s", ri->spawnId, ri->entry, gridX, gridY, GetZoneName(ri->zoneId, handler->GetSessionDbcLocale()), ri->zoneId, map->IsSpawnGroupActive(data->spawnGroupData->groupId) ? respawnTime.c_str() : "inactive"); } @@ -735,7 +736,7 @@ public: uint32 gridY = ri->gridId / MAX_NUMBER_OF_GRIDS; uint32 gridX = ri->gridId % MAX_NUMBER_OF_GRIDS; - std::string respawnTime = ri->respawnTime > time(NULL) ? secsToTimeString(uint64(ri->respawnTime - time(nullptr)), true) : stringOverdue; + std::string respawnTime = ri->respawnTime > GameTime::GetGameTime() ? secsToTimeString(uint64(ri->respawnTime - GameTime::GetGameTime()), true) : stringOverdue; handler->PSendSysMessage(UI64FMTD " | %u | [% 02u, % 02u] | %s (%u) | %s", ri->spawnId, ri->entry, gridX, gridY, GetZoneName(ri->zoneId, handler->GetSessionDbcLocale()), ri->zoneId, map->IsSpawnGroupActive(data->spawnGroupData->groupId) ? respawnTime.c_str() : "inactive"); } return true; diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 81f8e7ab7b9..991de3f28b9 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -1843,11 +1843,11 @@ public: // Output III. LANG_PINFO_BANNED if ban exists and is applied if (banTime >= 0) - handler->PSendSysMessage(LANG_PINFO_BANNED, banType.c_str(), banReason.c_str(), banTime > 0 ? secsToTimeString(banTime - time(nullptr), true).c_str() : handler->GetTrinityString(LANG_PERMANENTLY), bannedBy.c_str()); + handler->PSendSysMessage(LANG_PINFO_BANNED, banType.c_str(), banReason.c_str(), banTime > 0 ? secsToTimeString(banTime - GameTime::GetGameTime(), true).c_str() : handler->GetTrinityString(LANG_PERMANENTLY), bannedBy.c_str()); // Output IV. LANG_PINFO_MUTED if mute is applied if (muteTime > 0) - handler->PSendSysMessage(LANG_PINFO_MUTED, muteReason.c_str(), secsToTimeString(muteTime - time(nullptr), true).c_str(), muteBy.c_str()); + handler->PSendSysMessage(LANG_PINFO_MUTED, muteReason.c_str(), secsToTimeString(muteTime - GameTime::GetGameTime(), true).c_str(), muteBy.c_str()); // Output V. LANG_PINFO_ACC_ACCOUNT handler->PSendSysMessage(LANG_PINFO_ACC_ACCOUNT, userName.c_str(), accId, security); @@ -2020,7 +2020,7 @@ public: if (target) { // Target is online, mute will be in effect right away. - int64 muteTime = time(nullptr) + notSpeakTime * MINUTE; + int64 muteTime = GameTime::GetGameTime() + notSpeakTime * MINUTE; target->GetSession()->m_muteTime = muteTime; stmt->setInt64(0, muteTime); std::string nameLink = handler->playerLink(targetName); diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index fb501cf418d..5fdfaf812b4 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -27,6 +27,7 @@ EndScriptData */ #include "CreatureAI.h" #include "CreatureGroups.h" #include "DatabaseEnv.h" +#include "GameTime.h" #include "Language.h" #include "Log.h" #include "Map.h" @@ -823,7 +824,7 @@ public: uint32 nativeid = target->GetNativeDisplayId(); uint32 Entry = target->GetEntry(); - int64 curRespawnDelay = target->GetRespawnCompatibilityMode() ? target->GetRespawnTimeEx() - time(nullptr) : target->GetMap()->GetCreatureRespawnTime(target->GetSpawnId()) - time(nullptr); + int64 curRespawnDelay = target->GetRespawnCompatibilityMode() ? target->GetRespawnTimeEx() - GameTime::GetGameTime() : target->GetMap()->GetCreatureRespawnTime(target->GetSpawnId()) - GameTime::GetGameTime(); if (curRespawnDelay < 0) curRespawnDelay = 0; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp index cf899c1915d..6bfe4c555ed 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp @@ -404,7 +404,7 @@ public: return false; bool summoned = false; - time_t now = time(nullptr); + time_t now = GameTime::GetGameTime(); for (int32 i = first; i <= last; ++i) { if (_respawnCooldowns[i] > now) @@ -432,7 +432,7 @@ public: void ClearSlot(PassengerSlots slot) { _controlledSlots[slot].Clear(); - _respawnCooldowns[slot] = time(nullptr) + _slotInfo[slot].Cooldown; + _respawnCooldowns[slot] = GameTime::GetGameTime() + _slotInfo[slot].Cooldown; } bool SlotsNeedRefill(PassengerSlots first, PassengerSlots last) const @@ -853,7 +853,7 @@ class npc_high_overlord_saurfang_igb : public CreatureScript _controller.SetTransport(creature->GetTransport()); me->SetRegenerateHealth(false); me->m_CombatDistance = 70.0f; - _firstMageCooldown = time(nullptr) + 60; + _firstMageCooldown = GameTime::GetGameTime() + 60; _axethrowersYellCooldown = time_t(0); _rocketeersYellCooldown = time_t(0); } @@ -863,7 +863,7 @@ class npc_high_overlord_saurfang_igb : public CreatureScript ScriptedAI::InitializeAI(); _events.Reset(); - _firstMageCooldown = time(nullptr) + 60; + _firstMageCooldown = GameTime::GetGameTime() + 60; _axethrowersYellCooldown = time_t(0); _rocketeersYellCooldown = time_t(0); } @@ -915,7 +915,7 @@ class npc_high_overlord_saurfang_igb : public CreatureScript } else if (action == ACTION_SPAWN_MAGE) { - time_t now = time(nullptr); + time_t now = GameTime::GetGameTime(); if (_firstMageCooldown > now) _events.ScheduleEvent(EVENT_SUMMON_MAGE, (_firstMageCooldown - now) * IN_MILLISECONDS); else @@ -1049,10 +1049,10 @@ class npc_high_overlord_saurfang_igb : public CreatureScript case EVENT_CHECK_RIFLEMAN: if (_controller.SummonCreatures(SLOT_RIFLEMAN_1, Is25ManRaid() ? SLOT_RIFLEMAN_8 : SLOT_RIFLEMAN_4)) { - if (_axethrowersYellCooldown < time(nullptr)) + if (_axethrowersYellCooldown < GameTime::GetGameTime()) { Talk(SAY_SAURFANG_AXETHROWERS); - _axethrowersYellCooldown = time(nullptr) + 5; + _axethrowersYellCooldown = GameTime::GetGameTime() + 5; } } _events.ScheduleEvent(EVENT_CHECK_RIFLEMAN, 1000); @@ -1060,10 +1060,10 @@ class npc_high_overlord_saurfang_igb : public CreatureScript case EVENT_CHECK_MORTAR: if (_controller.SummonCreatures(SLOT_MORTAR_1, Is25ManRaid() ? SLOT_MORTAR_4 : SLOT_MORTAR_2)) { - if (_rocketeersYellCooldown < time(nullptr)) + if (_rocketeersYellCooldown < GameTime::GetGameTime()) { Talk(SAY_SAURFANG_ROCKETEERS); - _rocketeersYellCooldown = time(nullptr) + 5; + _rocketeersYellCooldown = GameTime::GetGameTime() + 5; } } _events.ScheduleEvent(EVENT_CHECK_MORTAR, 1000); @@ -1122,7 +1122,7 @@ class npc_muradin_bronzebeard_igb : public CreatureScript _controller.SetTransport(creature->GetTransport()); me->SetRegenerateHealth(false); me->m_CombatDistance = 70.0f; - _firstMageCooldown = time(nullptr) + 60; + _firstMageCooldown = GameTime::GetGameTime() + 60; _riflemanYellCooldown = time_t(0); _mortarYellCooldown = time_t(0); } @@ -1132,7 +1132,7 @@ class npc_muradin_bronzebeard_igb : public CreatureScript ScriptedAI::InitializeAI(); _events.Reset(); - _firstMageCooldown = time(nullptr) + 60; + _firstMageCooldown = GameTime::GetGameTime() + 60; _riflemanYellCooldown = time_t(0); _mortarYellCooldown = time_t(0); } @@ -1184,7 +1184,7 @@ class npc_muradin_bronzebeard_igb : public CreatureScript } else if (action == ACTION_SPAWN_MAGE) { - time_t now = time(nullptr); + time_t now = GameTime::GetGameTime(); if (_firstMageCooldown > now) _events.ScheduleEvent(EVENT_SUMMON_MAGE, (_firstMageCooldown - now) * IN_MILLISECONDS); else @@ -1322,10 +1322,10 @@ class npc_muradin_bronzebeard_igb : public CreatureScript case EVENT_CHECK_RIFLEMAN: if (_controller.SummonCreatures(SLOT_RIFLEMAN_1, Is25ManRaid() ? SLOT_RIFLEMAN_8 : SLOT_RIFLEMAN_4)) { - if (_riflemanYellCooldown < time(nullptr)) + if (_riflemanYellCooldown < GameTime::GetGameTime()) { Talk(SAY_MURADIN_RIFLEMAN); - _riflemanYellCooldown = time(nullptr) + 5; + _riflemanYellCooldown = GameTime::GetGameTime() + 5; } } _events.ScheduleEvent(EVENT_CHECK_RIFLEMAN, 1000); @@ -1333,10 +1333,10 @@ class npc_muradin_bronzebeard_igb : public CreatureScript case EVENT_CHECK_MORTAR: if (_controller.SummonCreatures(SLOT_MORTAR_1, Is25ManRaid() ? SLOT_MORTAR_4 : SLOT_MORTAR_2)) { - if (_mortarYellCooldown < time(nullptr)) + if (_mortarYellCooldown < GameTime::GetGameTime()) { Talk(SAY_MURADIN_MORTAR); - _mortarYellCooldown = time(nullptr) + 5; + _mortarYellCooldown = GameTime::GetGameTime() + 5; } } _events.ScheduleEvent(EVENT_CHECK_MORTAR, 1000); diff --git a/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp index c4d14660962..b3adec78b5b 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp @@ -16,6 +16,7 @@ */ #include "ScriptMgr.h" +#include "GameTime.h" #include "InstanceScript.h" #include "vault_of_archavon.h" @@ -64,13 +65,13 @@ class instance_vault_of_archavon : public InstanceMapScript switch (type) { case DATA_ARCHAVON: - ArchavonDeath = time(nullptr); + ArchavonDeath = GameTime::GetGameTime(); break; case DATA_EMALON: - EmalonDeath = time(nullptr); + EmalonDeath = GameTime::GetGameTime(); break; case DATA_KORALON: - KoralonDeath = time(nullptr); + KoralonDeath = GameTime::GetGameTime(); break; default: return true; diff --git a/src/server/scripts/Northrend/zone_wintergrasp.cpp b/src/server/scripts/Northrend/zone_wintergrasp.cpp index 1a79f4b98b2..fa25ca58d37 100644 --- a/src/server/scripts/Northrend/zone_wintergrasp.cpp +++ b/src/server/scripts/Northrend/zone_wintergrasp.cpp @@ -22,6 +22,7 @@ #include "DB2Stores.h" #include "GameObject.h" #include "GameObjectAI.h" +#include "GameTime.h" #include "ObjectMgr.h" #include "Player.h" #include "ScriptedCreature.h" @@ -309,7 +310,7 @@ class npc_wg_queue : public CreatureScript else { uint32 timer = wintergrasp->GetTimer() / 1000; - player->SendUpdateWorldState(4354, time(nullptr) + timer); + player->SendUpdateWorldState(4354, GameTime::GetGameTime() + timer); if (timer < 15 * MINUTE) { AddGossipItemFor(player, GOSSIP_ICON_CHAT, player->GetSession()->GetTrinityString(WG_NPCQUEUE_TEXTOPTION_JOIN), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 5ead906130d..81e169db811 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -2386,7 +2386,7 @@ class spell_item_crystal_prison_dummy_dnd : public SpellScript if (Creature* target = GetHitCreature()) if (target->isDead() && !target->IsPet()) { - GetCaster()->SummonGameObject(OBJECT_IMPRISONED_DOOMGUARD, *target, QuaternionData::fromEulerAnglesZYX(target->GetOrientation(), 0.0f, 0.0f), uint32(target->GetRespawnTime()-time(nullptr))); + GetCaster()->SummonGameObject(OBJECT_IMPRISONED_DOOMGUARD, *target, QuaternionData::fromEulerAnglesZYX(target->GetOrientation(), 0.0f, 0.0f), uint32(target->GetRespawnTime() - GameTime::GetGameTime())); target->DespawnOrUnsummon(); } } diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 2b4b568fa57..c69226f2587 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -140,7 +140,7 @@ class spell_pal_ardent_defender : public SpellScriptLoader int32 healAmount = int32(victim->CountPctFromMaxHealth(static_cast<uint32>(lroundf(_healPct * defenseFactor)))); victim->CastCustomSpell(victim, PAL_SPELL_ARDENT_DEFENDER_HEAL, &healAmount, nullptr, nullptr, true, nullptr, aurEff); - victim->ToPlayer()->AddSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL, 0, time(nullptr) + 120); + victim->ToPlayer()->AddSpellCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL, 0, GameTime::GetGameTime() + 120); } else if (remainingHealth < int32(allowedHealth)) { diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index d3c4a244816..cf4be0e3e3e 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1786,7 +1786,7 @@ public: void DamageTaken(Unit* doneBy, uint32& damage) override { AddThreat(doneBy, float(damage)); // just to create threat reference - _damageTimes[doneBy->GetGUID()] = time(nullptr); + _damageTimes[doneBy->GetGUID()] = GameTime::GetGameTime(); damage = 0; } @@ -1806,7 +1806,7 @@ public: { case EVENT_TD_CHECK_COMBAT: { - time_t now = time(nullptr); + time_t now = GameTime::GetGameTime(); for (std::unordered_map<ObjectGuid, time_t>::iterator itr = _damageTimes.begin(); itr != _damageTimes.end();) { // If unit has not dealt damage to training dummy for 5 seconds, remove him from combat |
