summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-10-14 19:13:38 +0000
committerrubidium <rubidium@openttd.org>2007-10-14 19:13:38 +0000
commitedc2a62669516a58165e670fecafdcf7e2bc9a5f (patch)
tree2906e18f537d8caae35dece3da89917938cb3d5c
parentf45b2e8d381a2028cd7d6a768551970aa6ce7c7a (diff)
downloadopenttd-edc2a62669516a58165e670fecafdcf7e2bc9a5f.tar.xz
(svn r11258) -Fix [FS#1325]: if a Load Amount callback returns 0, it means (according to TTDP's source code, not "the" specs) that it should take the "default" one.
-rw-r--r--src/economy.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index e4b9eb623..188b803e6 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -1525,7 +1525,7 @@ static void LoadUnloadVehicle(Vehicle *v, int *cargo_left)
byte load_amount = EngInfo(v->engine_type)->load_amount;
if (_patches.gradual_loading && HASBIT(EngInfo(v->engine_type)->callbackmask, CBM_VEHICLE_LOAD_AMOUNT)) {
uint16 cb_load_amount = GetVehicleCallback(CBID_VEHICLE_LOAD_AMOUNT, 0, 0, v->engine_type, v);
- if (cb_load_amount != CALLBACK_FAILED) load_amount = cb_load_amount & 0xFF;
+ if (cb_load_amount != CALLBACK_FAILED && cb_load_amount != 0) load_amount = cb_load_amount & 0xFF;
}
GoodsEntry *ge = &st->goods[v->cargo_type];