diff options
| author | Carbenium <carbenium@outlook.com> | 2020-07-25 20:09:03 +0200 |
|---|---|---|
| committer | Peter Keresztes Schmidt <carbenium@outlook.com> | 2020-07-25 23:10:14 +0200 |
| commit | d7ff8c272ad016296e1eed5aae325e4e5058ddd8 (patch) | |
| tree | 5a799d7db2de941da239a42d91bb3cade57cf4e7 /src/server/game | |
| parent | d5de96e46bf52ccb2fffe01c0709f9238977a80e (diff) | |
Core/InstanceScript: std::chrono-ify DoRespawnGameObject
Diffstat (limited to 'src/server/game')
| -rw-r--r-- | src/server/game/Instances/InstanceScript.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/Instances/InstanceScript.h | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index 1302028313c..44ea37c2361 100644 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -523,7 +523,7 @@ void InstanceScript::DoCloseDoorOrButton(ObjectGuid guid) TC_LOG_DEBUG("scripts", "InstanceScript: DoCloseDoorOrButton failed"); } -void InstanceScript::DoRespawnGameObject(ObjectGuid guid, uint32 timeToDespawn /*= MINUTE*/) +void InstanceScript::DoRespawnGameObject(ObjectGuid guid, Seconds timeToDespawn /*= 1min */) { if (GameObject* go = instance->GetGameObject(guid)) { @@ -543,7 +543,7 @@ void InstanceScript::DoRespawnGameObject(ObjectGuid guid, uint32 timeToDespawn / if (go->isSpawned()) return; - go->SetRespawnTime(timeToDespawn); + go->SetRespawnTime(timeToDespawn.count()); } else TC_LOG_DEBUG("scripts", "InstanceScript: DoRespawnGameObject failed"); diff --git a/src/server/game/Instances/InstanceScript.h b/src/server/game/Instances/InstanceScript.h index 80b084831c4..93eb5040c44 100644 --- a/src/server/game/Instances/InstanceScript.h +++ b/src/server/game/Instances/InstanceScript.h @@ -20,6 +20,7 @@ #include "ZoneScript.h" #include "Common.h" +#include "Duration.h" #include <map> #include <memory> #include <set> @@ -210,7 +211,7 @@ class TC_GAME_API InstanceScript : public ZoneScript void DoCloseDoorOrButton(ObjectGuid guid); // Respawns a GO having negative spawntimesecs in gameobject-table - void DoRespawnGameObject(ObjectGuid guid, uint32 timeToDespawn = MINUTE); + void DoRespawnGameObject(ObjectGuid guid, Seconds timeToDespawn = 1min); // Sends world state update to all players in instance void DoUpdateWorldState(uint32 worldstateId, uint32 worldstateValue); |
