mirror of https://github.com/OpenTTD/OpenTTD
Codefix: Correct handling of GetDepotOrderType() comparison (#13023)
In the function where we check the depot order type, using `!=` with GetDepotOrderType() is not ideal because the function can return flag bits.pull/13037/head
parent
9cf47e69d6
commit
a86f9dba0f
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue