1
0
Fork 0

Codefix: Correct handling of GetDepotOrderType() comparison

In the function where we check the depot order type, using `!=` with GetDepotOrderType() is not ideal because the function can return flag bits.
pull/13023/head
SamuXarick 2024-10-22 21:58:46 +01:00
parent 7a71df2952
commit d466539263
1 changed files with 1 additions and 1 deletions

View File

@ -273,7 +273,7 @@ bool Vehicle::NeedsAutomaticServicing() const
{
if (this->HasDepotOrder()) return false;
if (this->current_order.IsType(OT_LOADING)) return false;
if (this->current_order.IsType(OT_GOTO_DEPOT) && this->current_order.GetDepotOrderType() != ODTFB_SERVICE) return false;
if (this->current_order.IsType(OT_GOTO_DEPOT) && (this->current_order.GetDepotOrderType() & ODTFB_SERVICE) == 0) return false;
return NeedsServicing();
}