aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2021-04-06 00:05:46 +0200
committerShauren <shauren.trinity@gmail.com>2021-04-06 00:05:46 +0200
commit48b63c4c6721fa9a38f74f8fa92255ac0938da42 (patch)
treebb4260fda211f76fa5ebd9b9ffa111458cca3635
parentd29dd1eeb5c52dc76bd741fe1ee0e875c416b8e7 (diff)
Core/Groups: Use std::chrono type for Group::m_readyCheckTimer
-rw-r--r--src/server/game/Groups/Group.cpp12
-rw-r--r--src/server/game/Groups/Group.h4
2 files changed, 8 insertions, 8 deletions
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index 5115170d86a..eaa18b88257 100644
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -63,7 +63,7 @@ Group::Group() : m_leaderGuid(), m_leaderName(""), m_groupFlags(GROUP_FLAG_NONE)
m_dungeonDifficulty(DIFFICULTY_NORMAL), m_raidDifficulty(DIFFICULTY_NORMAL_RAID), m_legacyRaidDifficulty(DIFFICULTY_10_N),
m_bgGroup(nullptr), m_bfGroup(nullptr), m_lootMethod(FREE_FOR_ALL), m_lootThreshold(ITEM_QUALITY_UNCOMMON), m_looterGuid(),
m_masterLooterGuid(), m_subGroupsCounts(nullptr), m_guid(), m_maxEnchantingLevel(0), m_dbStoreId(0),
-m_readyCheckStarted(false), m_readyCheckTimer(0), m_activeMarkers(0)
+m_readyCheckStarted(false), m_readyCheckTimer(Milliseconds::zero()), m_activeMarkers(0)
{
for (uint8 i = 0; i < TARGET_ICONS_COUNT; ++i)
m_targetIcons[i].Clear();
@@ -2274,12 +2274,12 @@ void Group::UpdateReadyCheck(uint32 diff)
if (!m_readyCheckStarted)
return;
- m_readyCheckTimer -= diff;
- if (m_readyCheckTimer <= 0)
+ m_readyCheckTimer -= Milliseconds(diff);
+ if (m_readyCheckTimer <= Milliseconds::zero())
EndReadyCheck();
}
-void Group::StartReadyCheck(ObjectGuid starterGuid, int8 partyIndex, uint32 duration)
+void Group::StartReadyCheck(ObjectGuid starterGuid, int8 partyIndex, Milliseconds duration)
{
if (m_readyCheckStarted)
return;
@@ -2299,7 +2299,7 @@ void Group::StartReadyCheck(ObjectGuid starterGuid, int8 partyIndex, uint32 dura
readyCheckStarted.PartyGUID = m_guid;
readyCheckStarted.PartyIndex = partyIndex;
readyCheckStarted.InitiatorGUID = starterGuid;
- readyCheckStarted.Duration = duration;
+ readyCheckStarted.Duration = uint32(duration.count());
BroadcastPacket(readyCheckStarted.Write(), false);
}
@@ -2309,7 +2309,7 @@ void Group::EndReadyCheck(void)
return;
m_readyCheckStarted = false;
- m_readyCheckTimer = 0;
+ m_readyCheckTimer = Milliseconds::zero();
ResetMemberReadyChecked();
diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h
index 712b62537c4..734931b4646 100644
--- a/src/server/game/Groups/Group.h
+++ b/src/server/game/Groups/Group.h
@@ -270,7 +270,7 @@ class TC_GAME_API Group
void UpdateReadyCheck(uint32 diff);
// Ready check
- void StartReadyCheck(ObjectGuid starterGuid, int8 partyIndex, uint32 duration = READYCHECK_DURATION);
+ void StartReadyCheck(ObjectGuid starterGuid, int8 partyIndex, Milliseconds duration = Milliseconds(READYCHECK_DURATION));
void EndReadyCheck();
bool IsReadyCheckStarted(void) const { return m_readyCheckStarted; }
@@ -454,7 +454,7 @@ class TC_GAME_API Group
// Ready Check
bool m_readyCheckStarted;
- int32 m_readyCheckTimer;
+ Milliseconds m_readyCheckTimer;
// Raid markers
std::array<std::unique_ptr<RaidMarker>, RAID_MARKERS_COUNT> m_markers;