Fix 9494881e: NewGRF driving-backwards flag tested wrong part (#15579)

The DrivingBackwards flag is only ever set on the first vehicle of the consist, other vehicle parts in the consist may have indeterminate state.
This commit is contained in:
Peter Nelson
2026-05-04 23:00:46 +01:00
committed by GitHub
parent 8875e12956
commit eb52e2448d
+1 -1
View File
@@ -744,7 +744,7 @@ static uint32_t VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *objec
}
if (v->vehicle_flags.Test(VehicleFlag::CargoUnloading)) SetBit(modflags, 1);
if (v->vehicle_flags.Test(VehicleFlag::BuiltAsPrototype)) SetBit(modflags, 10);
if (v->vehicle_flags.Test(VehicleFlag::DrivingBackwards)) SetBit(modflags, 11);
if (v->IsDrivingBackwards()) SetBit(modflags, 11);
return variable == 0xFE ? modflags : GB(modflags, 8, 8);
}