Don't use occupancy of unload and leave empty orders for occupancy average

This commit is contained in:
Jonathan G Rennison
2023-04-09 23:34:29 +01:00
parent c0f7ab8071
commit 359fe89d2f
4 changed files with 25 additions and 3 deletions

View File

@@ -3503,8 +3503,9 @@ void Vehicle::RecalculateOrderOccupancyAverage()
uint total = 0;
uint order_count = this->GetNumOrders();
for (uint i = 0; i < order_count; i++) {
uint occupancy = this->GetOrder(i)->GetOccupancy();
if (occupancy > 0) {
const Order *order = this->GetOrder(i);
uint occupancy = order->GetOccupancy();
if (occupancy > 0 && order->UseOccupancyValueForAverage()) {
num_valid++;
total += (occupancy - 1);
}