Codechange: Use anonymous union for vehicle orders/old orders list
This commit is contained in:
@@ -91,7 +91,7 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr
|
||||
assert(ScriptOrder::IsValidVehicleOrder(vehicle_id, order_position));
|
||||
|
||||
int res = (int)order_position;
|
||||
const Order *order = v->orders.list->GetFirstOrder();
|
||||
const Order *order = v->orders->GetFirstOrder();
|
||||
for (; order->GetType() == OT_IMPLICIT; order = order->next) res++;
|
||||
while (order_position > 0) {
|
||||
order_position = (ScriptOrder::OrderPosition)(order_position - 1);
|
||||
|
@@ -454,7 +454,7 @@
|
||||
if (!IsValidVehicle(vehicle_id)) return false;
|
||||
|
||||
Vehicle *v = ::Vehicle::Get(vehicle_id);
|
||||
return v->orders.list != nullptr && v->orders.list->GetNumVehicles() > 1;
|
||||
return v->orders != nullptr && v->orders->GetNumVehicles() > 1;
|
||||
}
|
||||
|
||||
/* static */ int ScriptVehicle::GetReliability(VehicleID vehicle_id)
|
||||
|
Reference in New Issue
Block a user