(svn r23147) -Change: [NewGRF v8] Unify the return values of boolean callbacks, and check the results for validity.

This commit is contained in:
frosch
2011-11-08 17:26:49 +00:00
parent b98c7763de
commit 30874b5e81
11 changed files with 90 additions and 28 deletions

View File

@@ -661,7 +661,7 @@ bool IndustryTemporarilyRefusesCargo(Industry *ind, CargoID cargo_type)
uint16 res = GetIndustryCallback(CBID_INDUSTRY_REFUSE_CARGO,
0, GetReverseCargoTranslation(cargo_type, indspec->grf_prop.grffile),
ind, ind->type, ind->location.tile);
return res == 0;
if (res != CALLBACK_FAILED) return !ConvertBooleanCallback(indspec->grf_prop.grffile, CBID_INDUSTRY_REFUSE_CARGO, res);
}
return false;
}