File diff r27420:b37b70eb3169 → r27421:e8c2cdc1e8e6
src/newgrf_engine.cpp
Show inline comments
 
@@ -961,13 +961,13 @@ static uint32 VehicleGetVariable(Vehicle
 
		switch (variable) {
 
			case 0x43: return GetCompanyInfo(_current_company, LiveryHelper(this->self_type, nullptr)); // Owner information
 
			case 0x46: return 0;               // Motion counter
 
			case 0x47: { // Vehicle cargo info
 
				const Engine *e = Engine::Get(this->self_type);
 
				CargoID cargo_type = e->GetDefaultCargoType();
 
				if (cargo_type != CT_INVALID) {
 
				if (IsValidCargoID(cargo_type)) {
 
					const CargoSpec *cs = CargoSpec::Get(cargo_type);
 
					return (cs->classes << 16) | (cs->weight << 8) | this->ro.grffile->cargo_map[cargo_type];
 
				} else {
 
					return 0x000000FF;
 
				}
 
			}