equal
deleted
inserted
replaced
102 { |
102 { |
103 /* Pre-version 7 uses the 'climate dependent' ID, i.e. cargo is the cargo ID */ |
103 /* Pre-version 7 uses the 'climate dependent' ID, i.e. cargo is the cargo ID */ |
104 if (grffile->grf_version < 7) { |
104 if (grffile->grf_version < 7) { |
105 if (!usebit) return cargo; |
105 if (!usebit) return cargo; |
106 /* Else the cargo value is a 'climate independent' 'bitnum' */ |
106 /* Else the cargo value is a 'climate independent' 'bitnum' */ |
107 if (HASBIT(_cargo_mask, cargo)) return GetCargoIDByBitnum(cargo); |
107 if (HasBit(_cargo_mask, cargo)) return GetCargoIDByBitnum(cargo); |
108 } else { |
108 } else { |
109 /* If the GRF contains a translation table (and the cargo is in bounds) |
109 /* If the GRF contains a translation table (and the cargo is in bounds) |
110 * then get the cargo ID for the label */ |
110 * then get the cargo ID for the label */ |
111 if (cargo < grffile->cargo_max) return GetCargoIDByLabel(grffile->cargo_list[cargo]); |
111 if (cargo < grffile->cargo_max) return GetCargoIDByLabel(grffile->cargo_list[cargo]); |
112 } |
112 } |