horse: use straight front type in racecourse api

This commit is contained in:
2026-10-10 13:37:12 -04:00
parent 381df5bd35
commit 3a39794312
3 changed files with 30 additions and 38 deletions
+3 -4
View File
@@ -139,9 +139,8 @@ func spansslopes(id horse.RacecourseID, evts []courseEvent, length float32) ([]h
}
// Start of the straight.
span = horse.RacecourseSpan{
Start: evt.Distance,
Straight: true,
FarStraight: evt.Values[1] == 2,
Start: evt.Distance,
Straight: int8(evt.Values[1]),
}
// Continue out of the switch.
}
@@ -154,7 +153,7 @@ func spansslopes(id horse.RacecourseID, evts []courseEvent, length float32) ([]h
// Longchamp 1000 (which doesn't appear to actually be used but w/e)
// defines straights by their start positions only, so check for the
// previous event being a straight with no end.
if prev.Straight && prev.End == 0 {
if prev.Straight != 0 && prev.End == 0 {
spans[len(spans)-1].End = span.Start
} else {
// Otherwise, insert a new span which is neither straight nor corner.