Vehicle: don't instantiate disabled vehicles (#32919)

This commit is contained in:
Michael Geers 2026-08-18 10:41:47 +02:00 • committed by GitHub
parent 8cf5a44a32
commit adfbd057b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 74 additions and 12 deletions

View file

@ -538,9 +538,14 @@ func configureVehicles(static []config.Named, names ...string) error {
}
}
instance, err := vehicleInstance(cc)
if err != nil {
return fmt.Errorf("cannot create vehicle '%s': %w", cc.Name, err)
// disabled vehicles are not instantiated
var instance api.Vehicle
if !conf.Disable {
var err error
instance, err = vehicleInstance(cc)
if err != nil {
return fmt.Errorf("cannot create vehicle '%s': %w", cc.Name, err)
}
}
mu.Lock()