Skip to content

Commit

Permalink
Update extras/ai-battle/HeadlessGame.cpp
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Grund <[email protected]>
  • Loading branch information
wichern and Flamefire authored Jun 16, 2024
1 parent ed90565 commit 543eb8e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions extras/ai-battle/HeadlessGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::chrono::hours>(time);
auto minutes = std::chrono::duration_cast<std::chrono::minutes>(time % std::chrono::hours(1));
auto seconds = std::chrono::duration_cast<std::chrono::seconds>(time % std::chrono::minutes(1));
const auto hours = std::chrono::duration_cast<std::chrono::hours>(time);
const auto minutes = std::chrono::duration_cast<std::chrono::minutes>(time % std::chrono::hours(1));
const auto seconds = std::chrono::duration_cast<std::chrono::seconds>(time % std::chrono::minutes(1));
snprintf(buffer, 90, "%03ld:%02ld:%02ld", static_cast<long int>(hours.count()),
static_cast<long int>(minutes.count()), static_cast<long int>(seconds.count()));
return std::string(buffer);
Expand Down

0 comments on commit 543eb8e

Please sign in to comment.