(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.
authorrubidium
Sun, 14 Oct 2007 19:13:38 +0000
changeset 7723 0274fb967b78
parent 7722 8da8bafcdf12
child 7724 b056c58fb5d9
(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.
src/economy.cpp
--- a/src/economy.cpp	Sun Oct 14 14:50:07 2007 +0000
+++ b/src/economy.cpp	Sun Oct 14 19:13:38 2007 +0000
@@ -1525,7 +1525,7 @@
 		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];