From 543eb8e8b9155de2adfbec73c7f08cd651cf48c4 Mon Sep 17 00:00:00 2001 From: wichern <47030768+wichern@users.noreply.github.com> Date: Sun, 16 Jun 2024 21:12:42 +0200 Subject: [PATCH] Update extras/ai-battle/HeadlessGame.cpp Co-authored-by: Alexander Grund --- extras/ai-battle/HeadlessGame.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extras/ai-battle/HeadlessGame.cpp b/extras/ai-battle/HeadlessGame.cpp index ec1d8f020..ee56bb0ce 100644 --- a/extras/ai-battle/HeadlessGame.cpp +++ b/extras/ai-battle/HeadlessGame.cpp @@ -164,9 +164,9 @@ void HeadlessGame::SaveGame(const bfs::path& path) const std::string ToString(const std::chrono::milliseconds& time) { char buffer[90]; - auto hours = std::chrono::duration_cast(time); - auto minutes = std::chrono::duration_cast(time % std::chrono::hours(1)); - auto seconds = std::chrono::duration_cast(time % std::chrono::minutes(1)); + const auto hours = std::chrono::duration_cast(time); + const auto minutes = std::chrono::duration_cast(time % std::chrono::hours(1)); + const auto seconds = std::chrono::duration_cast(time % std::chrono::minutes(1)); snprintf(buffer, 90, "%03ld:%02ld:%02ld", static_cast(hours.count()), static_cast(minutes.count()), static_cast(seconds.count())); return std::string(buffer);