From cdb0a7695820ac088df6736cb59ac9989f945c8e Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 17 Feb 2013 14:54:50 +0000 Subject: (svn r25012) -Codechange: persistently keep 'reserved' cargo (for full-load improved loading) instead of calculating if for every cycle --- src/autoreplace_cmd.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/autoreplace_cmd.cpp') diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp index 7571da114..e8d292140 100644 --- a/src/autoreplace_cmd.cpp +++ b/src/autoreplace_cmd.cpp @@ -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); } } -- cgit v1.2.3-54-g00ecf