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

@@ -382,6 +382,18 @@ static bool ShipAccelerate(Vehicle *v)
spd = min(v->cur_speed + 1, v->vcache.cached_max_speed);
spd = min(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 = min(spd, v->breakdown_severity);
}
/* updates statusbar only if speed have changed to save CPU time */
if (spd != v->cur_speed) {
v->cur_speed = spd;
@@ -702,6 +714,7 @@ CommandCost CmdBuildShip(TileIndex tile, DoCommandFlag flags, const Engine *e, u
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();
_new_vehicle_id = v->index;