diff --git a/src/common/Collision/DynamicTree.cpp b/src/common/Collision/DynamicTree.cpp index 35047464231..b6f26e3443d 100644 --- a/src/common/Collision/DynamicTree.cpp +++ b/src/common/Collision/DynamicTree.cpp @@ -103,7 +103,7 @@ struct DynTreeImpl : public ParentTree/*, public Intersectable*/ } } - TimeTrackerSmall rebalance_timer; + TimeTracker rebalance_timer; int unbalanced_times; }; diff --git a/src/common/Utilities/Timer.h b/src/common/Utilities/Timer.h index 8acd5cbdc11..89fa2a0ef1a 100644 --- a/src/common/Utilities/Timer.h +++ b/src/common/Utilities/Timer.h @@ -115,81 +115,41 @@ struct IntervalTimer struct TimeTracker { public: - - TimeTracker(time_t expiry) - : i_expiryTime(expiry) - { - } - - void Update(time_t diff) - { - i_expiryTime -= diff; - } - - bool Passed() const - { - return i_expiryTime <= 0; - } - - void Reset(time_t interval) - { - i_expiryTime = interval; - } - - time_t GetExpiry() const - { - return i_expiryTime; - } - -private: - - time_t i_expiryTime; -}; - -struct TimeTrackerSmall -{ -public: - - TimeTrackerSmall(int32 expiry = 0) - : i_expiryTime(expiry) - { - } - - TimeTrackerSmall(Milliseconds expiry) : i_expiryTime(expiry.count()) { } + TimeTracker(int32 expiry = 0) : _expiryTime(expiry) { } + TimeTracker(Milliseconds expiry) : _expiryTime(expiry) { } void Update(int32 diff) { - i_expiryTime -= diff; + Update(Milliseconds(diff)); } void Update(Milliseconds diff) { - Update(diff.count()); + _expiryTime -= diff; } bool Passed() const { - return i_expiryTime <= 0; + return _expiryTime <= 0s; } - void Reset(int32 interval) + void Reset(int32 expiry) { - i_expiryTime = interval; + Reset(Milliseconds(expiry)); } void Reset(Milliseconds expiry) { - Reset(expiry.count()); + _expiryTime = expiry; } Milliseconds GetExpiry() const { - return Milliseconds(i_expiryTime); + return _expiryTime; } private: - - int32 i_expiryTime; + Milliseconds _expiryTime; }; struct PeriodicTimer diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index a1d191b48e3..1c3978a8367 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -2425,7 +2425,7 @@ class TC_GAME_API Player : public Unit, public GridObject bool m_needsZoneUpdate; - TimeTrackerSmall m_groupUpdateTimer; + TimeTracker m_groupUpdateTimer; private: // internal common parts for CanStore/StoreItem functions diff --git a/src/server/game/Entities/Transport/Transport.h b/src/server/game/Entities/Transport/Transport.h index 55eacf0c601..6f2b30f7408 100644 --- a/src/server/game/Entities/Transport/Transport.h +++ b/src/server/game/Entities/Transport/Transport.h @@ -117,7 +117,7 @@ class TC_GAME_API Transport : public GameObject, public TransportBase KeyFrameVec::const_iterator _currentFrame; KeyFrameVec::const_iterator _nextFrame; - TimeTrackerSmall _positionChangeTimer; + TimeTracker _positionChangeTimer; bool _isMoving; bool _pendingStop; diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 43999fadf10..3ea466d9f0f 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1800,7 +1800,7 @@ class TC_GAME_API Unit : public WorldObject uint32 m_state; // Even derived shouldn't modify uint32 m_lastManaUse; // msecs - TimeTrackerSmall m_splineSyncTimer; + TimeTracker m_splineSyncTimer; DiminishingReturn m_Diminishing[DIMINISHING_MAX]; diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h index ff12ddb7e79..d316bfeaddc 100644 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -370,6 +370,6 @@ class TC_GAME_API Group uint32 m_maxEnchantingLevel; uint32 m_dbStoreId; // Represents the ID used in database (Can be reused by other groups if group was disbanded) bool m_isLeaderOffline; - TimeTrackerSmall m_leaderOfflineTimer; + TimeTracker m_leaderOfflineTimer; }; #endif diff --git a/src/server/game/Movement/MovementGenerators/ChaseMovementGenerator.h b/src/server/game/Movement/MovementGenerators/ChaseMovementGenerator.h index 5c08a01965d..6010f164d13 100644 --- a/src/server/game/Movement/MovementGenerators/ChaseMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/ChaseMovementGenerator.h @@ -51,7 +51,7 @@ class ChaseMovementGenerator : public MovementGenerator, public AbstractFollower std::unique_ptr _path; Optional _lastTargetPosition; - TimeTrackerSmall _rangeCheckTimer; + TimeTracker _rangeCheckTimer; bool _movingTowards = true; bool _mutualChase = true; }; diff --git a/src/server/game/Movement/MovementGenerators/FollowMovementGenerator.h b/src/server/game/Movement/MovementGenerators/FollowMovementGenerator.h index e3661cef014..455a3535921 100644 --- a/src/server/game/Movement/MovementGenerators/FollowMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/FollowMovementGenerator.h @@ -53,7 +53,7 @@ class FollowMovementGenerator : public MovementGenerator, public AbstractFollowe float const _range; ChaseAngle const _angle; - TimeTrackerSmall _checkTimer; + TimeTracker _checkTimer; std::unique_ptr _path; Optional _lastTargetPosition; }; diff --git a/src/server/game/Movement/MovementGenerators/FormationMovementGenerator.h b/src/server/game/Movement/MovementGenerators/FormationMovementGenerator.h index 4c3adaf192b..481e050ff07 100644 --- a/src/server/game/Movement/MovementGenerators/FormationMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/FormationMovementGenerator.h @@ -51,7 +51,7 @@ class FormationMovementGenerator : public MovementGeneratorMedium : public MovementGeneratorMedium