Full Version: last lap time appears middle of first lap
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've noticed that on some (not sure if all) tracks the last lap field in the timer (but not the best lap) is suddenly filled in out of the blue. I'm using the development version of course...
Has anyone else noticed this?
I noticed this also. Haven't look at the code, but I think(or rather guess) this happens when the player car cross timing sector 1.
Fixed in r1687.
Yes it seems that way, thanks for the fix. Did you figure out what caused this to change? I know it was working properly before. Will track reversal be affected by your fix? I'll do some testing later on.
I'm not sure when it was introduced. Anyway below is a long-winded explanation of the bug. Smile

In the track record file, there is a section for last lap time with the car name, lap sequence 0 and lap sequence 1 time.

The logic of displaying the last lap time is to compare the track record last lap car name against the current car name, if the name differ, display '--:--:--', otherwise, display the value stored in lap sequence 0.

If you select a car which is different from the track record last lap car, '--:--:--' will be displayed at the beginning of race, which is correct. However, when you reach lap sequence 1, TIMER::Lap() will be called. This function will update the car name and lap sequence 1 time. But it does not update the lap sequence 0 time.

After this, when the last lap time display function compares the car name, since they are the same, it will treat the lap sequence 0 time as the last lap time and display in the timer box. This is why it suddenly appears when you reach lap sequence 1.