Skip to content

Commit

Permalink
is this what you wanted
Browse files Browse the repository at this point in the history
  • Loading branch information
EmosewaMC committed Jun 13, 2024
1 parent 642d41b commit 71642a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions dGame/dComponents/RacingControlComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,8 +828,8 @@ void RacingControlComponent::Update(float deltaTime) {

// Reached the start point, lapped
if (respawnIndex == 0) {
auto now = std::chrono::high_resolution_clock::now();
auto lapTime = std::chrono::duration_cast<std::chrono::milliseconds>(now - (player.lap == 0 ? m_StartTime : player.lapTime));
const auto now = std::chrono::high_resolution_clock::now();
const auto lapTime = std::chrono::duration_cast<std::chrono::milliseconds>(now - (player.lap == 0 ? m_StartTime : player.lapTime));

// Cheating check
if (lapTime.count() < 40000) {
Expand Down
4 changes: 2 additions & 2 deletions dGame/dComponents/RacingControlComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct RacingPlayerInfo {
/**
* The current lap time of the player
*/
std::chrono::system_clock::time_point lapTime;
std::chrono::high_resolution_clock::time_point lapTime;

/**
* The number of times this player smashed their car
Expand Down Expand Up @@ -232,7 +232,7 @@ class RacingControlComponent final : public Component {
/**
* The time the race was started
*/
std::chrono::system_clock::time_point m_StartTime;
std::chrono::high_resolution_clock::time_point m_StartTime;

/**
* Timer for tracking how long a player was alone in this race
Expand Down

0 comments on commit 71642a2

Please sign in to comment.