(svn r9029) -Fix (r7326): Only call the gradual loading amount callback if the bit for it is set in the vehicle's callbackmask.

This commit is contained in:
maedhros
2007-03-06 19:12:56 +00:00
parent 38cc68898d
commit 878b6fcf37
2 changed files with 3 additions and 3 deletions

View File

@@ -1368,7 +1368,7 @@ int LoadUnloadVehicle(Vehicle *v, bool just_arrived)
for (; v != NULL; v = v->next) {
GoodsEntry* ge;
load_amount = EngInfo(v->engine_type)->load_amount;
if (_patches.gradual_loading) {
if (_patches.gradual_loading && HASBIT(EngInfo(v->engine_type)->callbackmask, CBM_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;
}