File diff r26193:4bc7915a2156 → r26194:f7347205838e
src/ship_cmd.cpp
Show inline comments
 
@@ -219,6 +219,7 @@ Money Ship::GetRunningCost() const
 
{
 
	const Engine *e = this->GetEngine();
 
	uint cost_factor = GetVehicleProperty(this, PROP_SHIP_RUNNING_COST_FACTOR, e->u.ship.running_cost);
 
	cost_factor *= _settings_game.economy.running_cost_multiplier_water;
 
	return GetPrice(PR_RUNNING_SHIP, cost_factor, e->GetGRF());
 
}
 

	
 
@@ -414,6 +415,18 @@ static bool ShipAccelerate(Vehicle *v)
 
	spd = std::min<uint>(v->cur_speed + 1, v->vcache.cached_max_speed);
 
	spd = std::min<uint>(spd, v->current_order.GetMaxSpeed() * 2);
 

	
 
	if(v->breakdown_ctr == 1 && v->breakdown_type == BREAKDOWN_LOW_POWER && v->cur_speed > (v->breakdown_severity * ShipVehInfo(v->engine_type)->max_speed) >> 8) {
 
		if((v->tick_counter & 0x7) == 0 && v->cur_speed > 0) {
 
			spd = v->cur_speed - 1;
 
		} else {
 
			spd = v->cur_speed;
 
		}
 
	}
 

	
 
	if(v->breakdown_ctr == 1 && v->breakdown_type == BREAKDOWN_LOW_SPEED) {
 
		spd = std::min<uint>(spd, v->breakdown_severity);
 
	}
 

	
 
	/* updates statusbar only if speed have changed to save CPU time */
 
	if (spd != v->cur_speed) {
 
		v->cur_speed = spd;
 
@@ -878,6 +891,7 @@ CommandCost CmdBuildShip(DoCommandFlag f
 

	
 
		v->reliability = e->reliability;
 
		v->reliability_spd_dec = e->reliability_spd_dec;
 
		v->breakdown_chance = 64; // ships have a 50% lower breakdown chance than normal
 
		v->max_age = e->GetLifeLengthInDays();
 

	
 
		v->state = TRACK_BIT_DEPOT;