Fix indentation/whitespace issues in breakdown code.

This commit is contained in:
Jonathan G Rennison
2015-09-07 00:54:33 +01:00
parent 0650568aee
commit 876a21b3c1

View File

@@ -1193,8 +1193,7 @@ static const byte _breakdown_chances[4][4] = {
* @param v the vehicle in question.
* @param r the random number to use. (Note that bits 0..6 are already used)
*/
void
DetermineBreakdownType( Vehicle *v, uint32 r ) {
void DetermineBreakdownType(Vehicle *v, uint32 r) {
/* if 'improved breakdowns' is off, just do the classic breakdown */
if (!_settings_game.vehicle.improved_breakdowns) {
v->breakdown_type = BREAKDOWN_CRITICAL;
@@ -1341,7 +1340,6 @@ bool Vehicle::HandleBreakdown()
(this->current_order.GetDepotOrderType() & ODTFB_BREAKDOWN) &&
GetTargetAirportIfValid(Aircraft::From(this)) != NULL)) return false;
FindBreakdownDestination(Aircraft::From(this));
} else if (this->type == VEH_TRAIN) {
if (this->breakdown_type == BREAKDOWN_LOW_POWER ||
this->First()->cur_speed <= ((this->breakdown_type == BREAKDOWN_LOW_SPEED) ? this->breakdown_severity : 0)) {
@@ -1365,10 +1363,8 @@ bool Vehicle::HandleBreakdown()
if (rvi->max_speed > this->vcache.cached_max_speed)
this->vcache.cached_max_speed = rvi->max_speed;
}
this->vcache.cached_max_speed =
min(
this->vcache.cached_max_speed - (this->vcache.cached_max_speed >> 1) / Train::From(this->First())->tcache.cached_num_engines + 1,
this->vcache.cached_max_speed);
this->vcache.cached_max_speed = min(this->vcache.cached_max_speed -
(this->vcache.cached_max_speed >> 1) / Train::From(this->First())->tcache.cached_num_engines + 1, this->vcache.cached_max_speed);
SetBit(Train::From(this)->flags, VRF_NEED_REPAIR);
Train::From(this->First())->ConsistChanged(CCF_TRACK);
}
@@ -1386,7 +1382,6 @@ bool Vehicle::HandleBreakdown()
break;
default: NOT_REACHED();
}
this->First()->MarkDirty();
SetWindowDirty(WC_VEHICLE_VIEW, this->index);
SetWindowDirty(WC_VEHICLE_DETAILS, this->index);
@@ -1419,8 +1414,8 @@ bool Vehicle::HandleBreakdown()
break;
default: NOT_REACHED();
}
if ( ( !( this->vehstatus & VS_HIDDEN ) ) && (
( this->breakdown_type == BREAKDOWN_LOW_SPEED || this->breakdown_type == BREAKDOWN_LOW_POWER ) &&
if ((!(this->vehstatus & VS_HIDDEN)) &&
((this->breakdown_type == BREAKDOWN_LOW_SPEED || this->breakdown_type == BREAKDOWN_LOW_POWER) &&
(this->tick_counter & 0x1F) == 0)) {
/* Some gray clouds to indicate a broken RV */
CreateEffectVehicleRel(this, 0, 0, 2, EV_BREAKDOWN_SMOKE);