(svn r8849) -Codechange: Replace hardcoded global/climate cargo mapping tables with dynamically generated data. Change associated code to use new functions.

This commit is contained in:
peter1138
2007-02-22 22:09:51 +00:00
parent 4f41a8a5e2
commit 6062004960
12 changed files with 75 additions and 131 deletions

View File

@@ -3658,9 +3658,10 @@ static void CalculateRefitMasks(void)
if (cargo_allowed[engine] != 0) {
// Build up the list of cargo types from the set cargo classes.
for (i = 0; i < lengthof(cargo_classes); i++) {
if (HASBIT(cargo_allowed[engine], i)) mask |= cargo_classes[i];
if (HASBIT(cargo_disallowed[engine], i)) not_mask |= cargo_classes[i];
for (i = 0; i < NUM_CARGO; i++) {
const CargoSpec *cs = GetCargo(i);
if (cargo_allowed[engine] & cs->classes) SETBIT(mask, cs->bitnum);
if (cargo_disallowed[engine] & cs->classes) SETBIT(not_mask, cs->bitnum);
}
} else {
// Don't apply default refit mask to wagons or engines with no capacity
@@ -3673,7 +3674,7 @@ static void CalculateRefitMasks(void)
xor_mask = _default_refitmasks[GetEngine(engine)->type];
}
}
_engine_info[engine].refit_mask = ((mask & ~not_mask) ^ xor_mask) & _landscape_global_cargo_mask[_opt.landscape];
_engine_info[engine].refit_mask = ((mask & ~not_mask) ^ xor_mask) & _cargo_mask;
}
}