src/newgrf_cargo.cpp
branchnoai
changeset 9722 ebf0ece7d8f6
parent 9718 f82a4facea8b
child 9060 3bc3c707719b
equal deleted inserted replaced
9721:9a27928bcd5e 9722:ebf0ece7d8f6
   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 	}