summaryrefslogtreecommitdiff
path: root/src/autoreplace_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-02-17 14:54:50 +0000
committerrubidium <rubidium@openttd.org>2013-02-17 14:54:50 +0000
commitcdb0a7695820ac088df6736cb59ac9989f945c8e (patch)
tree4eb4c9a8818a518622d32c3599c1c3e285dafdbe /src/autoreplace_cmd.cpp
parent446d50f6580d6d71ac30d6d64b72cb3e5c4c3aaa (diff)
downloadopenttd-cdb0a7695820ac088df6736cb59ac9989f945c8e.tar.xz
(svn r25012) -Codechange: persistently keep 'reserved' cargo (for full-load improved loading) instead of calculating if for every cycle
Diffstat (limited to 'src/autoreplace_cmd.cpp')
-rw-r--r--src/autoreplace_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
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);
}
}