summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2016-05-29 13:35:17 +0000
committerfrosch <frosch@openttd.org>2016-05-29 13:35:17 +0000
commitb0c56f3432645b505672adae8938f1a4e70febc3 (patch)
tree9caabf2c808d65cff8116c655eaa888f86329dfd
parentdac94c7cbc6455bd004eb410f384bad205e32dc9 (diff)
downloadopenttd-b0c56f3432645b505672adae8938f1a4e70febc3.tar.xz
(svn r27585) -Fix [FS#6437]: Enforce a non-zero load amount for all vehicles, so that vehicles can process their cargo reservations.
-rw-r--r--src/economy.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index 121fc6733..cdfa059e8 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -1317,7 +1317,8 @@ static uint GetLoadAmount(Vehicle *v)
/* Scale load amount the same as capacity */
if (HasBit(e->info.misc_flags, EF_NO_DEFAULT_CARGO_MULTIPLIER) && !air_mail) load_amount = CeilDiv(load_amount * CargoSpec::Get(v->cargo_type)->multiplier, 0x100);
- return load_amount;
+ /* Zero load amount breaks a lot of things. */
+ return max(1u, load_amount);
}
/**