Merge branch 'master' of ssh://esilva.org:666/home/esilva/privGit/ibtReader

This commit is contained in:
2024-11-05 15:51:13 +00:00
2 changed files with 3 additions and 4 deletions
Binary file not shown.
+3 -4
View File
@@ -210,6 +210,9 @@ func (i *IBT) Update(timeout time.Duration) (IRacingState, error) {
start := i.Headers.BufOffset + i.Vars.Tick*i.Headers.BufLen
buf := make([]byte, i.Headers.BufLen)
_, err := i.File.ReadAt(buf, int64(start))
if err == io.EOF {
return Ended, nil
}
if err != nil {
return Unknown, err
}
@@ -219,10 +222,6 @@ func (i *IBT) Update(timeout time.Duration) (IRacingState, error) {
log.Fatalf("What happened?\n%v\n", err)
}
if err == io.EOF {
return Ended, nil
}
// This was previously in the read data method, but it probably fits here better
i.Vars.Tick++
}