Fix the stateinvalid logic

This commit is contained in:
2026-09-08 16:02:38 +01:00
parent 78ec6a1e86
commit 7a210af58d
+3 -7
View File
@@ -280,19 +280,15 @@ func (i *IBT) SessionStateInvalid() bool {
return true return true
} }
value, ok := val.Value.(string) value, ok := val.Value.(int)
if !ok { if !ok {
return true return true
} }
bitfield, err := strconv.ParseInt(value, 0, 64) return value == irsdk_StateInvalid
if err != nil {
return true
}
return bitfield == irsdk_StateInvalid
} }
// BUG: Need to fix all of these functions, they are all wrong
func (i *IBT) SessionStateGetInCar() bool { func (i *IBT) SessionStateGetInCar() bool {
val, ok := i.Vars.Vars["SessionState"] val, ok := i.Vars.Vars["SessionState"]
if !ok { if !ok {