(svn r8891) -Codechange: Remove remains of global cargo scheme. All cargo mapping is now dealt with only in NewGRF code, on load where possible.

This commit is contained in:
peter1138
2007-02-24 23:36:40 +00:00
parent bc968d23f1
commit 6b7a4ba448
9 changed files with 42 additions and 114 deletions

View File

@@ -762,8 +762,7 @@ bool CanFillVehicle(Vehicle *v)
*/
bool CanRefitTo(EngineID engine_type, CargoID cid_to)
{
CargoID cid = GetCargo(cid_to)->bitnum;
return HASBIT(EngInfo(engine_type)->refit_mask, cid);
return HASBIT(EngInfo(engine_type)->refit_mask, cid_to);
}
/** Find the first cargo type that an engine can be refitted to.
@@ -776,7 +775,7 @@ CargoID FindFirstRefittableCargo(EngineID engine_type)
if (refit_mask != 0) {
for (CargoID cid = CT_PASSENGERS; cid < NUM_CARGO; cid++) {
if (HASBIT(refit_mask, GetCargo(cid)->bitnum)) return cid;
if (HASBIT(refit_mask, cid)) return cid;
}
}