eckhchri / pcars-ds-liveview

Provides a html page for project cars dedicated server and display a map of the current race.
14 stars 1 forks source link

Reference error on FastestLapTime #65

Open viper4gh opened 8 years ago

viper4gh commented 8 years ago

Yesterday I had a reference error only one time. On the CalcGaps call there was an undefined FastestLapTime, but I don't know which one it was.

code block where it happens:

for (i=0; i < a.length; i++) {

    if (i == 0){
        Gaps = CalcGaps(a[i].FastestLapTime,a[0].FastestLapTime,a[i].FastestLapTime);
    }else{
        Gaps = CalcGaps(a[i].FastestLapTime,a[0].FastestLapTime,a[i-1].FastestLapTime);
    }
viper4gh commented 8 years ago

error1 error2

1459965965069.zip

viper4gh commented 8 years ago

Second screenshot is wrong. The error is thrown in the if statement: Gaps = CalcGaps(a[i].FastestLapTime,a[0].FastestLapTime,a[i].FastestLapTime);