File diff r26193:4bc7915a2156 → r26194:f7347205838e
src/engine.cpp
Show inline comments
 
@@ -273,28 +273,32 @@ Money Engine::GetRunningCost() const
 
	uint cost_factor;
 
	switch (this->type) {
 
		case VEH_ROAD:
 
			base_price = this->u.road.running_cost_class;
 
			if (base_price == INVALID_PRICE) return 0;
 
			cost_factor = GetEngineProperty(this->index, PROP_ROADVEH_RUNNING_COST_FACTOR, this->u.road.running_cost);
 
			cost_factor *= _settings_game.economy.running_cost_multiplier_road;
 
			break;
 

	
 
		case VEH_TRAIN:
 
			base_price = this->u.rail.running_cost_class;
 
			if (base_price == INVALID_PRICE) return 0;
 
			cost_factor = GetEngineProperty(this->index, PROP_TRAIN_RUNNING_COST_FACTOR, this->u.rail.running_cost);
 
			cost_factor *= _settings_game.economy.running_cost_multiplier_rail;
 
			break;
 

	
 
		case VEH_SHIP:
 
			base_price = PR_RUNNING_SHIP;
 
			cost_factor = GetEngineProperty(this->index, PROP_SHIP_RUNNING_COST_FACTOR, this->u.ship.running_cost);
 
			cost_factor *= _settings_game.economy.running_cost_multiplier_water;
 
			break;
 

	
 
		case VEH_AIRCRAFT:
 
			base_price = PR_RUNNING_AIRCRAFT;
 
			cost_factor = GetEngineProperty(this->index, PROP_AIRCRAFT_RUNNING_COST_FACTOR, this->u.air.running_cost);
 
			cost_factor *= _settings_game.economy.running_cost_multiplier_air;
 
			break;
 

	
 
		default: NOT_REACHED();
 
	}
 

	
 
	return GetPrice(base_price, cost_factor, this->GetGRF(), -8);
 
@@ -440,13 +444,13 @@ Date Engine::GetLifeLengthInDays() const
 
 * @return Range of the aircraft type in tiles or 0 if unlimited range.
 
 */
 
uint16 Engine::GetRange() const
 
{
 
	switch (this->type) {
 
		case VEH_AIRCRAFT:
 
			return GetEngineProperty(this->index, PROP_AIRCRAFT_RANGE, this->u.air.max_range);
 
			return (GetEngineProperty(this->index, PROP_AIRCRAFT_RANGE, this->u.air.max_range) * _settings_game.vehicle.plane_range_multiplier);
 

	
 
		default: NOT_REACHED();
 
	}
 
}
 

	
 
/**