diff options
author | Jelle Meeus <sogladev@gmail.com> | 2025-09-03 16:20:04 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-03 20:20:04 -0300 |
commit | 1e29c31b079cb56a76265a816efce5b620e6a175 (patch) | |
tree | a73ab166c346e2b386b23f8198191de83ae8a599 /src | |
parent | 599d206584f801adf3e42fede6bf0496605b60c3 (diff) |
fix(Scripts/WorldState): defeated scourge zone invasions not restarting after a defeat (#22783)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/World/WorldState.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/server/game/World/WorldState.cpp b/src/server/game/World/WorldState.cpp index a1f71a2a51..106e8fd991 100644 --- a/src/server/game/World/WorldState.cpp +++ b/src/server/game/World/WorldState.cpp @@ -1072,8 +1072,8 @@ std::string WorldState::GetScourgeInvasionPrintout() { TimePoint tp = m_siData.m_timers[timerId]; std::string timerStr; - if (tp.time_since_epoch().count() == 0) - timerStr = "0 (not set)"; + if (tp == TimePoint()) + timerStr = "Not set"; else if (tp <= now) timerStr = "Elapsed"; else @@ -1420,10 +1420,15 @@ void ScourgeInvasionData::Reset() std::string ScourgeInvasionData::GetData() { std::string output = std::to_string(m_state) + " "; - for (auto& timer : m_timers) - output += std::to_string(timer.time_since_epoch().count()) + " "; + for (TimePoint& timer : m_timers) + { + if (timer == TimePoint()) + output += "0 "; + else + output += std::to_string(std::chrono::duration_cast<std::chrono::milliseconds>(timer.time_since_epoch()).count()) + " "; + } output += std::to_string(m_battlesWon) + " " + std::to_string(m_lastAttackZone) + " "; - for (auto& remaining : m_remaining) + for (uint32& remaining : m_remaining) output += std::to_string(remaining) + " "; return output; } |