Import Improved Breakdowns patch

Fix trailing whitespace

http://www.tt-forums.net/viewtopic.php?p=1146419#p1146419
This commit is contained in:
patch-import
2015-08-02 22:58:41 +01:00
committed by Jonathan G Rennison
parent c8a727d3fc
commit 9f5164b403
24 changed files with 761 additions and 84 deletions

View File

@@ -91,9 +91,12 @@ struct GroundVehicle : public SpecializedVehicle<T, Type> {
void PowerChanged();
void CargoChanged();
int GetAcceleration() const;
bool IsChainInDepot() const;
void CalculatePower(uint32& power, uint32& max_te, bool breakdowns) const;
int GetAcceleration();
/**
* Common code executed for crashed ground vehicles
* @param flooded was this vehicle flooded?
@@ -369,7 +372,22 @@ protected:
/* When we are going faster than the maximum speed, reduce the speed
* somewhat gradually. But never lower than the maximum speed. */
int tempmax = max_speed;
int tempmax = ((this->breakdown_ctr == 1) ? this->cur_speed : max_speed);
if (this->breakdown_ctr == 1) {
if (this->breakdown_type == BREAKDOWN_LOW_POWER) {
if((this->tick_counter & 0x7) == 0) {
if(this->cur_speed > (this->breakdown_severity * max_speed) >> 8) {
tempmax = this->cur_speed - (this->cur_speed / 10) - 1;
} else {
tempmax = (this->breakdown_severity * max_speed) >> 8;
}
}
}
if(this->breakdown_type == BREAKDOWN_LOW_SPEED)
tempmax = min(max_speed, this->breakdown_severity);
}
if (this->cur_speed > max_speed) {
tempmax = max(this->cur_speed - (this->cur_speed / 10) - 1, max_speed);
}