(svn r25012) -Codechange: persistently keep 'reserved' cargo (for full-load improved loading) instead of calculating if for every cycle

This commit is contained in:
rubidium
2013-02-17 14:54:50 +00:00
parent c62cbe04a4
commit 7dd2354a13
12 changed files with 614 additions and 335 deletions

View File

@@ -106,7 +106,7 @@ void CheckCargoCapacity(Vehicle *v)
if (dest->cargo.Count() >= dest->cargo_cap || dest->cargo_type != src->cargo_type) continue;
uint amount = min(to_spread, dest->cargo_cap - dest->cargo.Count());
src->cargo.MoveTo(&dest->cargo, amount, VehicleCargoList::MTA_UNLOAD, NULL);
src->cargo.Shift(amount, &dest->cargo);
to_spread -= amount;
}
@@ -145,7 +145,7 @@ static void TransferCargo(Vehicle *old_veh, Vehicle *new_head, bool part_of_chai
uint amount = min(src->cargo.Count(), dest->cargo_cap - dest->cargo.Count());
if (amount <= 0) continue;
src->cargo.MoveTo(&dest->cargo, amount, VehicleCargoList::MTA_UNLOAD, NULL);
src->cargo.Shift(amount, &dest->cargo);
}
}