During SessionStage Race1 and Race2 the number of pits is recorded.
In result it is possible to read this data from the recording file instead of counting it again during playback.
The big benefit: you can jump to every point during playback without loosing the correct number of pits, because the counting only works correct if the playback runs in real time an sees the driver state changes from not "EnteringPits" to "Entering Pits".
Following steps needed:
Only run the complete counting logic if not in APIMODE DEMO
expand the PCARSDriver with numPits
add numPits in the DEMO receive mode
Possible problem:
numPits is only available during race, the receive function have to read the data from demo file, where numPits is not available in other sessions.
Further consequence:
Old recordings have no numPits info. It will don't show the number of pits during playback.
During SessionStage Race1 and Race2 the number of pits is recorded. In result it is possible to read this data from the recording file instead of counting it again during playback. The big benefit: you can jump to every point during playback without loosing the correct number of pits, because the counting only works correct if the playback runs in real time an sees the driver state changes from not "EnteringPits" to "Entering Pits".
Following steps needed:
Possible problem: numPits is only available during race, the receive function have to read the data from demo file, where numPits is not available in other sessions.
Further consequence: Old recordings have no numPits info. It will don't show the number of pits during playback.