Open viper4gh opened 4 years ago
The driver state in the one second is "Finished" and could be used as exclusion criteria, but then the last race lap will not be added to the sum, because then the driver state is also "Finished".
Solved, but test with some sessions if the Race Gaps are not reset in other situations.
The Race Gap calculation happens only on SessionStage Race. The Gap data is reset on the switch between quali and race. The initial lap counter is set to 1, because the race starts with lap 1. The trigger for sum up of lap times is a lap counter increase by 1. Now there is the problem, that in the moment when the Stage changes to Race the old Qualifying data is still available in the API for ca. 1 second. In this case drivers with 2 laps in qualifying reach the lap increase trigger, which identifies an increase by 1 ( from initial 1 to now 2) and the last qualifing lap time is added to the race lap time sum, which is wrong.