diff options
Diffstat (limited to 'src')
20 files changed, 36 insertions, 36 deletions
diff --git a/src/common/Utilities/EventMap.cpp b/src/common/Utilities/EventMap.cpp index b82507b5281..ae83ab0571f 100644 --- a/src/common/Utilities/EventMap.cpp +++ b/src/common/Utilities/EventMap.cpp @@ -33,7 +33,7 @@ void EventMap::SetPhase(uint8 phase) _phase = uint8(1 << (phase - 1)); } -void EventMap::ScheduleEvent(uint32 eventId, Milliseconds const& minTime, Milliseconds const& maxTime, uint32 group /*= 0*/, uint32 phase /*= 0*/) +void EventMap::ScheduleEvent(uint32 eventId, Milliseconds minTime, Milliseconds maxTime, uint32 group /*= 0*/, uint32 phase /*= 0*/) { ScheduleEvent(eventId, urand(uint32(minTime.count()), uint32(maxTime.count())), group, phase); } @@ -49,7 +49,7 @@ void EventMap::ScheduleEvent(uint32 eventId, uint32 time, uint32 group /*= 0*/, _eventMap.insert(EventStore::value_type(_time + time, eventId)); } -void EventMap::RescheduleEvent(uint32 eventId, Milliseconds const& minTime, Milliseconds const& maxTime, uint32 group /*= 0*/, uint32 phase /*= 0*/) +void EventMap::RescheduleEvent(uint32 eventId, Milliseconds minTime, Milliseconds maxTime, uint32 group /*= 0*/, uint32 phase /*= 0*/) { RescheduleEvent(eventId, urand(uint32(minTime.count()), uint32(maxTime.count())), group, phase); } diff --git a/src/common/Utilities/EventMap.h b/src/common/Utilities/EventMap.h index e8f062c54fe..6c99665126e 100644 --- a/src/common/Utilities/EventMap.h +++ b/src/common/Utilities/EventMap.h @@ -120,7 +120,7 @@ public: * @param group The group which the event is associated to. Has to be between 1 and 8. 0 means it has no group. * @param phase The phase in which the event can occur. Has to be between 1 and 8. 0 means it can occur in all phases. */ - void ScheduleEvent(uint32 eventId, Milliseconds const& time, uint32 group = 0, uint8 phase = 0) + void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group = 0, uint8 phase = 0) { ScheduleEvent(eventId, uint32(time.count()), group, phase); } @@ -134,7 +134,7 @@ public: * @param group The group which the event is associated to. Has to be between 1 and 8. 0 means it has no group. * @param phase The phase in which the event can occur. Has to be between 1 and 8. 0 means it can occur in all phases. */ - void ScheduleEvent(uint32 eventId, Milliseconds const& minTime, Milliseconds const& maxTime, uint32 group = 0, uint32 phase = 0); + void ScheduleEvent(uint32 eventId, Milliseconds minTime, Milliseconds maxTime, uint32 group = 0, uint32 phase = 0); /** * @name ScheduleEvent @@ -154,7 +154,7 @@ public: * @param group The group which the event is associated to. Has to be between 1 and 8. 0 means it has no group. * @param phase The phase in which the event can occur. Has to be between 1 and 8. 0 means it can occur in all phases. */ - void RescheduleEvent(uint32 eventId, Milliseconds const& time, uint32 group = 0, uint8 phase = 0) + void RescheduleEvent(uint32 eventId, Milliseconds time, uint32 group = 0, uint8 phase = 0) { RescheduleEvent(eventId, uint32(time.count()), group, phase); } @@ -168,7 +168,7 @@ public: * @param group The group which the event is associated to. Has to be between 1 and 8. 0 means it has no group. * @param phase The phase in which the event can occur. Has to be between 1 and 8. 0 means it can occur in all phases. */ - void RescheduleEvent(uint32 eventId, Milliseconds const& minTime, Milliseconds const& maxTime, uint32 group = 0, uint32 phase = 0); + void RescheduleEvent(uint32 eventId, Milliseconds minTime, Milliseconds maxTime, uint32 group = 0, uint32 phase = 0); /** * @name RescheduleEvent @@ -189,7 +189,7 @@ public: * @brief Repeats the mostly recently executed event. * @param time Time until in milliseconds as std::chrono::duration the event occurs. */ - void Repeat(Milliseconds const& time) + void Repeat(Milliseconds time) { Repeat(uint32(time.count())); } @@ -210,7 +210,7 @@ public: * @param minTime Minimum time as std::chrono::duration until the event occurs. * @param maxTime Maximum time as std::chrono::duration until the event occurs. */ - void Repeat(Milliseconds const& minTime, Milliseconds const& maxTime) + void Repeat(Milliseconds minTime, Milliseconds maxTime) { Repeat(uint32(minTime.count()), uint32(maxTime.count())); } @@ -235,7 +235,7 @@ public: * @brief Delays all events in the map. If delay is greater than or equal internal timer, delay will be 0. * @param delay Amount of delay in ms as std::chrono::duration. */ - void DelayEvents(Milliseconds const& delay) + void DelayEvents(Milliseconds delay) { DelayEvents(uint32(delay.count())); } @@ -256,7 +256,7 @@ public: * @param delay Amount of delay in ms as std::chrono::duration. * @param group Group of the events. */ - void DelayEvents(Milliseconds const& delay, uint32 group) + void DelayEvents(Milliseconds delay, uint32 group) { DelayEvents(uint32(delay.count()), group); } diff --git a/src/common/Utilities/EventProcessor.h b/src/common/Utilities/EventProcessor.h index 57246a03831..62af07e6189 100644 --- a/src/common/Utilities/EventProcessor.h +++ b/src/common/Utilities/EventProcessor.h @@ -78,7 +78,7 @@ class TC_COMMON_API EventProcessor void Update(uint32 p_time); void KillAllEvents(bool force); void AddEvent(BasicEvent* event, uint64 e_time, bool set_addtime = true); - void AddEventAtOffset(BasicEvent* event, Milliseconds const& offset) { AddEvent(event, CalculateTime(offset.count())); } + void AddEventAtOffset(BasicEvent* event, Milliseconds offset) { AddEvent(event, CalculateTime(offset.count())); } void ModifyEventTime(BasicEvent* event, uint64 newTime); uint64 CalculateTime(uint64 t_offset) const { return m_time + t_offset; } diff --git a/src/common/Utilities/Random.cpp b/src/common/Utilities/Random.cpp index ddb285436ec..a693cf486d9 100644 --- a/src/common/Utilities/Random.cpp +++ b/src/common/Utilities/Random.cpp @@ -62,7 +62,7 @@ float frand(float min, float max) return float(GetRng()->Random() * (max - min) + min); } -Milliseconds randtime(Milliseconds const& min, Milliseconds const& max) +Milliseconds randtime(Milliseconds min, Milliseconds max) { long long diff = max.count() - min.count(); ASSERT(diff >= 0); diff --git a/src/common/Utilities/Random.h b/src/common/Utilities/Random.h index ab0dfc7e9e3..50b0578d032 100644 --- a/src/common/Utilities/Random.h +++ b/src/common/Utilities/Random.h @@ -35,7 +35,7 @@ TC_COMMON_API uint32 urandms(uint32 min, uint32 max); TC_COMMON_API uint32 rand32(); /* Return a random time in the range min..max (up to millisecond precision). Only works for values where millisecond difference is a valid uint32. */ -TC_COMMON_API Milliseconds randtime(Milliseconds const& min, Milliseconds const& max); +TC_COMMON_API Milliseconds randtime(Milliseconds min, Milliseconds max); /* Return a random number in the range min..max */ TC_COMMON_API float frand(float min, float max); diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 85c72c17e9f..0ac2b3be021 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2100,7 +2100,7 @@ void Creature::Respawn(bool force) } -void Creature::ForcedDespawn(uint32 timeMSToDespawn, Seconds const& forceRespawnTimer) +void Creature::ForcedDespawn(uint32 timeMSToDespawn, Seconds forceRespawnTimer) { if (timeMSToDespawn) { @@ -2152,7 +2152,7 @@ void Creature::ForcedDespawn(uint32 timeMSToDespawn, Seconds const& forceRespawn } } -void Creature::DespawnOrUnsummon(uint32 msTimeToDespawn /*= 0*/, Seconds const& forceRespawnTimer /*= 0*/) +void Creature::DespawnOrUnsummon(uint32 msTimeToDespawn /*= 0*/, Seconds forceRespawnTimer /*= 0*/) { if (TempSummon* summon = ToTempSummon()) summon->UnSummon(msTimeToDespawn); diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index f77934b1616..23e567f7332 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -246,8 +246,8 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma void RemoveCorpse(bool setSpawnTime = true, bool destroyForNearbyPlayers = true); - void DespawnOrUnsummon(uint32 msTimeToDespawn = 0, Seconds const& forceRespawnTime = Seconds(0)); - void DespawnOrUnsummon(Milliseconds const& time, Seconds const& forceRespawnTime = Seconds(0)) { DespawnOrUnsummon(uint32(time.count()), forceRespawnTime); } + void DespawnOrUnsummon(uint32 msTimeToDespawn = 0, Seconds forceRespawnTime = 0s); + void DespawnOrUnsummon(Milliseconds time, Seconds forceRespawnTime = 0s) { DespawnOrUnsummon(uint32(time.count()), forceRespawnTime); } time_t const& GetRespawnTime() const { return m_respawnTime; } time_t GetRespawnTimeEx() const; @@ -417,7 +417,7 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma bool CanAlwaysSee(WorldObject const* obj) const override; private: - void ForcedDespawn(uint32 timeMSToDespawn = 0, Seconds const& forceRespawnTimer = Seconds(0)); + void ForcedDespawn(uint32 timeMSToDespawn = 0, Seconds forceRespawnTimer = 0s); bool CheckNoGrayAggroConfig(uint32 playerLevel, uint32 creatureLevel) const; // No aggro from gray creatures // Waypoint path @@ -462,7 +462,7 @@ class TC_GAME_API AssistDelayEvent : public BasicEvent class TC_GAME_API ForcedDespawnDelayEvent : public BasicEvent { public: - ForcedDespawnDelayEvent(Creature& owner, Seconds const& respawnTimer) : BasicEvent(), m_owner(owner), m_respawnTimer(respawnTimer) { } + ForcedDespawnDelayEvent(Creature& owner, Seconds respawnTimer) : BasicEvent(), m_owner(owner), m_respawnTimer(respawnTimer) { } bool Execute(uint64 e_time, uint32 p_time) override; private: diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 5d8cc2fd3d1..b623a0e8881 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -834,7 +834,7 @@ void GameObject::AddUniqueUse(Player* player) m_unique_users.insert(player->GetGUID()); } -void GameObject::DespawnOrUnsummon(Milliseconds const& delay, Seconds const& forceRespawnTime) +void GameObject::DespawnOrUnsummon(Milliseconds delay, Seconds forceRespawnTime) { if (delay > 0ms) { diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index f9024db5505..c8308ded896 100644 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -151,7 +151,7 @@ class TC_GAME_API GameObject : public WorldObject, public GridObject<GameObject> void SetSpawnedByDefault(bool b) { m_spawnedByDefault = b; } uint32 GetRespawnDelay() const { return m_respawnDelayTime; } void Refresh(); - void DespawnOrUnsummon(Milliseconds const& delay = 0ms, Seconds const& forceRespawnTime = 0s); + void DespawnOrUnsummon(Milliseconds delay = 0ms, Seconds forceRespawnTime = 0s); void Delete(); void getFishLoot(Loot* loot, Player* loot_owner); void getFishLootJunk(Loot* loot, Player* loot_owner); diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 4dbeee9d2bb..e19602f97ff 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -385,7 +385,7 @@ class TC_GAME_API WorldObject : public Object, public WorldLocation ZoneScript* GetZoneScript() const { return m_zoneScript; } TempSummon* SummonCreature(uint32 entry, Position const& pos, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime = 0, uint32 vehId = 0, uint32 spellId = 0); - TempSummon* SummonCreature(uint32 entry, Position const& pos, TempSummonType despawnType, Milliseconds const& despawnTime, uint32 vehId = 0, uint32 spellId = 0) { return SummonCreature(entry, pos, despawnType, uint32(despawnTime.count()), vehId, spellId); } + TempSummon* SummonCreature(uint32 entry, Position const& pos, TempSummonType despawnType, Milliseconds despawnTime, uint32 vehId = 0, uint32 spellId = 0) { return SummonCreature(entry, pos, despawnType, uint32(despawnTime.count()), vehId, spellId); } TempSummon* SummonCreature(uint32 entry, float x, float y, float z, float o = 0, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime = 0); GameObject* SummonGameObject(uint32 entry, Position const& pos, QuaternionData const& rot, uint32 respawnTime /* s */, GOSummonType summonType = GO_SUMMON_TIMED_OR_CORPSE_DESPAWN); GameObject* SummonGameObject(uint32 entry, float x, float y, float z, float ang, QuaternionData const& rot, uint32 respawnTime /* s */); diff --git a/src/server/game/Scripting/ScriptReloadMgr.cpp b/src/server/game/Scripting/ScriptReloadMgr.cpp index 7fcbcc7566d..3e38adcfc43 100644 --- a/src/server/game/Scripting/ScriptReloadMgr.cpp +++ b/src/server/game/Scripting/ScriptReloadMgr.cpp @@ -1034,7 +1034,7 @@ private: // Wait for the current build job to finish, if the job finishes in time // evaluate it and continue with the next one. if (_build_job->GetProcess()->GetFutureResult(). - wait_for(std::chrono::seconds(0)) == std::future_status::ready) + wait_for(0s) == std::future_status::ready) ProcessReadyBuildJob(); else return; // Return when the job didn't finish in time diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 9b2ce6fe4a9..5b3df4da99c 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -1107,11 +1107,11 @@ void WorldSession::ProcessQueryCallbacks() { _queryProcessor.ProcessReadyQueries(); - if (_realmAccountLoginCallback.valid() && _realmAccountLoginCallback.wait_for(std::chrono::seconds(0)) == std::future_status::ready) + if (_realmAccountLoginCallback.valid() && _realmAccountLoginCallback.wait_for(0s) == std::future_status::ready) InitializeSessionCallback(_realmAccountLoginCallback.get()); //! HandlePlayerLoginOpcode - if (_charLoginCallback.valid() && _charLoginCallback.wait_for(std::chrono::seconds(0)) == std::future_status::ready) + if (_charLoginCallback.valid() && _charLoginCallback.wait_for(0s) == std::future_status::ready) HandlePlayerLogin(reinterpret_cast<LoginQueryHolder*>(_charLoginCallback.get())); } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp index 53a011a5997..23fba8cc3f5 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp @@ -167,7 +167,7 @@ public: void SetupGroundPhase() { events.SetPhase(PHASE_GROUND); - events.ScheduleEvent(EVENT_CLEAVE, Seconds(0), Seconds(15), GROUP_GROUND); + events.ScheduleEvent(EVENT_CLEAVE, 0s, Seconds(15), GROUP_GROUND); events.ScheduleEvent(EVENT_TAIL_SWEEP, Seconds(4), Seconds(23), GROUP_GROUND); events.ScheduleEvent(EVENT_BELLOWING_ROAR, Seconds(48), GROUP_GROUND); events.ScheduleEvent(EVENT_CHARRED_EARTH, Seconds(12), Seconds(18), GROUP_GROUND); diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp index 25d8ee1a4a1..3865f8e777d 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp @@ -386,12 +386,12 @@ public: _assassinCount = 6; _guardianCount = 2; _venomancerCount = 2; - events.ScheduleEvent(EVENT_DARTER, Seconds(0), 0, PHASE_SUBMERGE); + events.ScheduleEvent(EVENT_DARTER, 0s, 0, PHASE_SUBMERGE); break; } _petCount = _guardianCount + _venomancerCount; if (_assassinCount) - events.ScheduleEvent(EVENT_ASSASSIN, Seconds(0), 0, PHASE_SUBMERGE); + events.ScheduleEvent(EVENT_ASSASSIN, 0s, 0, PHASE_SUBMERGE); if (_guardianCount) events.ScheduleEvent(EVENT_GUARDIAN, Seconds(4), 0, PHASE_SUBMERGE); if (_venomancerCount) diff --git a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp index e81104ac77f..6347974d543 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp @@ -103,7 +103,7 @@ class boss_faerlina : public CreatureScript summons.DoZoneInCombat(); events.ScheduleEvent(EVENT_POISON, randtime(Seconds(10), Seconds(15))); events.ScheduleEvent(EVENT_FIRE, randtime(Seconds(6), Seconds(18))); - events.ScheduleEvent(EVENT_FRENZY, Minutes(1)+randtime(Seconds(0), Seconds(20))); + events.ScheduleEvent(EVENT_FRENZY, Minutes(1)+randtime(0s, Seconds(20))); } void Reset() override @@ -173,7 +173,7 @@ class boss_faerlina : public CreatureScript { DoCast(SPELL_FRENZY); Talk(EMOTE_FRENZY); - events.Repeat(Minutes(1) + randtime(Seconds(0), Seconds(20))); + events.Repeat(Minutes(1) + randtime(0s, Seconds(20))); } break; } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp index 8a377da4acc..6194d545a2b 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp @@ -533,7 +533,7 @@ class boss_gothik : public CreatureScript break; case EVENT_RESUME_ATTACK: me->SetReactState(REACT_AGGRESSIVE); - events.ScheduleEvent(EVENT_BOLT, Seconds(0), 0, PHASE_TWO); + events.ScheduleEvent(EVENT_BOLT, 0s, 0, PHASE_TWO); // return to the start of this method so victim side etc is re-evaluated return UpdateAI(0u); // tail recursion for efficiency case EVENT_BOLT: diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp index eb7cd9451d6..8d2ba4ce1c6 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp @@ -182,7 +182,7 @@ class boss_sapphiron : public CreatureScript me->CastSpell(me, SPELL_FROST_AURA, true); events.SetPhase(PHASE_GROUND); - events.ScheduleEvent(EVENT_CHECK_RESISTS, Seconds(0)); + events.ScheduleEvent(EVENT_CHECK_RESISTS, 0s); events.ScheduleEvent(EVENT_BERSERK, Minutes(15)); EnterPhaseGround(true); } @@ -207,7 +207,7 @@ class boss_sapphiron : public CreatureScript void MovementInform(uint32 /*type*/, uint32 id) override { if (id == 1) - events.ScheduleEvent(EVENT_LIFTOFF, Seconds(0), 0, PHASE_FLIGHT); + events.ScheduleEvent(EVENT_LIFTOFF, 0s, 0, PHASE_FLIGHT); } void DoAction(int32 param) override diff --git a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp index 3be62e1aeb7..6f2280af4ae 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp @@ -223,7 +223,7 @@ class boss_erekem : public CreatureScript task.Repeat(Seconds(8), Seconds(13)); }); - scheduler.Schedule(Seconds(0), [this](TaskContext task) + scheduler.Schedule(0s, [this](TaskContext task) { for (uint32 i = DATA_EREKEM_GUARD_1; i <= DATA_EREKEM_GUARD_2; ++i) { diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp index eaf52379fe8..3487fcdd92a 100644 --- a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp @@ -585,7 +585,7 @@ class npc_azure_saboteur : public CreatureScript { if (type == EFFECT_MOTION_TYPE && pointId == POINT_INTRO) { - _scheduler.Schedule(Seconds(0), [this](TaskContext task) + _scheduler.Schedule(0s, [this](TaskContext task) { me->CastSpell(me, SPELL_SHIELD_DISRUPTION, false); diff --git a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp index 68c4cae48c5..388c9c35942 100644 --- a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp @@ -1460,7 +1460,7 @@ public: switch (me->GetEntry()) { case NPC_ENRAGED_WATER_SPIRIT: - _events.ScheduleEvent(EVENT_ENRAGED_WATER_SPIRIT, Seconds(0), Seconds(1)); + _events.ScheduleEvent(EVENT_ENRAGED_WATER_SPIRIT, 0s, Seconds(1)); break; case NPC_ENRAGED_FIRE_SPIRIT: if (!me->GetAura(SPELL_FEL_FIRE_AURA)) |