feat: add millisecond tracking for racing (#1615)

* add millisecond tracking

Update RacingControlComponent.cpp

* remove const ig?

* is this what you wanted
This commit is contained in:
David Markowitz
2024-10-26 20:59:50 -07:00
committed by GitHub
parent 33a8efdd22
commit 102e3556cf
2 changed files with 24 additions and 25 deletions

View File

@@ -8,6 +8,7 @@
#include "Entity.h"
#include "Component.h"
#include "eReplicaComponentType.h"
#include <chrono>
/**
* Information for each player in the race
@@ -72,12 +73,12 @@ struct RacingPlayerInfo {
/**
* The fastest lap time of the player
*/
time_t bestLapTime = 0;
std::chrono::milliseconds bestLapTime;
/**
* The current lap time of the player
*/
time_t lapTime = 0;
std::chrono::high_resolution_clock::time_point lapTime;
/**
* The number of times this player smashed their car
@@ -97,7 +98,7 @@ struct RacingPlayerInfo {
/**
* Unused
*/
time_t raceTime = 0;
std::chrono::milliseconds raceTime;
};
/**
@@ -231,7 +232,7 @@ private:
/**
* The time the race was started
*/
time_t m_StartTime;
std::chrono::high_resolution_clock::time_point m_StartTime;
/**
* Timer for tracking how long a player was alone in this race