mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-01 08:48:21 +01:00
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.
This commit is contained in:
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
Block a user