Core/Misc: Change Float*chrono* typedefs to double to match return type of chrono_literals

Signed-off-by: luis <[email protected]>
This commit is contained in:
Shauren
2026-04-16 19:41:23 -03:00
committed by luis
parent 6ca0d65ea6
commit 3dbf70aa9f
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -22,19 +22,19 @@
/// Milliseconds shorthand typedef.
using Milliseconds = std::chrono::milliseconds;
using FloatMilliseconds = std::chrono::duration<float, Milliseconds::period>;
using FloatMilliseconds = std::chrono::duration<double, Milliseconds::period>;
/// Seconds shorthand typedef.
using Seconds = std::chrono::seconds;
using FloatSeconds = std::chrono::duration<float, Seconds::period>;
using FloatSeconds = std::chrono::duration<double, Seconds::period>;
/// Minutes shorthand typedef.
using Minutes = std::chrono::minutes;
using FloatMinutes = std::chrono::duration<float, Minutes::period>;
using FloatMinutes = std::chrono::duration<double, Minutes::period>;
/// Hours shorthand typedef.
using Hours = std::chrono::hours;
using FloatHours = std::chrono::duration<float, Hours::period>;
using FloatHours = std::chrono::duration<double, Hours::period>;
/// time_point shorthand typedefs
typedef std::chrono::steady_clock::time_point TimePoint;
+2 -2
View File
@@ -2046,8 +2046,8 @@ float Aura::CalcPPMProcChance(Unit* actor) const
float averageProcInterval = 60.0f / ppm;
TimePoint currentTime = GameTime::Now();
float secondsSinceLastAttempt = std::min(duration_cast<FloatSeconds>(currentTime - m_lastProcAttemptTime).count(), 10.0f);
float secondsSinceLastProc = std::min(duration_cast<FloatSeconds>(currentTime - m_lastProcSuccessTime).count(), 1000.0f);
float secondsSinceLastAttempt = std::min(duration_cast<FloatSeconds>(currentTime - m_lastProcAttemptTime).count(), 10.0);
float secondsSinceLastProc = std::min(duration_cast<FloatSeconds>(currentTime - m_lastProcSuccessTime).count(), 1000.0);
float chance = std::max(1.0f, 1.0f + ((secondsSinceLastProc / averageProcInterval - 1.5f) * 3.0f)) * ppm * secondsSinceLastAttempt / 60.0f;
RoundToInterval(chance, 0.0f, 1.0f);