Changeset - r18297:6e2a79b57f98
[Not reviewed]
master
0 1 0
frosch - 13 years ago 2011-11-08 17:25:32
frosch@openttd.org
(svn r23143) -Change: [NewGRF v8] Return the translated cargobit in vehicle var 42.
1 file changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/newgrf_engine.cpp
Show inline comments
 
@@ -531,7 +531,10 @@ static uint32 VehicleGetVariable(Vehicle
 
					}
 
				}
 

	
 
				uint8 common_bitnum = (common_cargo_type == CT_INVALID ? 0xFF : CargoSpec::Get(common_cargo_type)->bitnum);
 
				/* Unlike everywhere else the cargo translation table is only used since grf version 8, not 7. */
 
				const GRFFile *grffile = v->GetGRF();
 
				uint8 common_bitnum = (common_cargo_type == CT_INVALID) ? 0xFF :
 
					(grffile->grf_version < 8) ? CargoSpec::Get(common_cargo_type)->bitnum : grffile->cargo_map[common_cargo_type];
 
				v->grf_cache.consist_cargo_information = cargo_classes | (common_bitnum << 8) | (common_subtype << 16) | (user_def_data << 24);
 
				SetBit(v->grf_cache.cache_valid, NCVV_CONSIST_CARGO_INFORMATION);
 
			}
0 comments (0 inline, 0 general)