summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-04-18 17:53:06 +0000
committerrubidium <rubidium@openttd.org>2008-04-18 17:53:06 +0000
commitfb466f4db2ea281586b48368b8d24b13de73168f (patch)
tree02d3799ae4707c9ac8724bab8be125a9c5010ce3 /src
parent7edc9b65c6d1f20ab53336578bce7053810e930b (diff)
downloadopenttd-fb466f4db2ea281586b48368b8d24b13de73168f.tar.xz
(svn r12772) -Codechange: some vehicle.cpp coding style.
Diffstat (limited to 'src')
-rw-r--r--src/vehicle.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 76491b627..3cc82188b 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -835,11 +835,9 @@ static void ChimneySmokeTick(Vehicle *v)
if (v->progress > 0) {
v->progress--;
} else {
- TileIndex tile;
-
BeginVehicleMove(v);
- tile = TileVirtXY(v->x_pos, v->y_pos);
+ TileIndex tile = TileVirtXY(v->x_pos, v->y_pos);
if (!IsTileType(tile, MP_INDUSTRY)) {
EndVehicleMove(v);
delete v;
@@ -1487,10 +1485,10 @@ void CheckVehicleBreakdown(Vehicle *v)
/* decrease reliability */
v->reliability = rel = max((rel_old = v->reliability) - v->reliability_spd_dec, 0);
- if ((rel_old >> 8) != (rel >> 8))
- InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
+ if ((rel_old >> 8) != (rel >> 8)) InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
if (v->breakdown_ctr != 0 || v->vehstatus & VS_STOPPED ||
+ _opt.diff.vehicle_breakdowns < 1 ||
v->cur_speed < 5 || _game_mode == GM_MENU) {
return;
}
@@ -1499,16 +1497,13 @@ void CheckVehicleBreakdown(Vehicle *v)
/* increase chance of failure */
int chance = v->breakdown_chance + 1;
- if (Chance16I(1,25,r)) chance += 25;
+ if (Chance16I(1, 25, r)) chance += 25;
v->breakdown_chance = min(255, chance);
/* calculate reliability value to use in comparison */
rel = v->reliability;
if (v->type == VEH_SHIP) rel += 0x6666;
- /* disabled breakdowns? */
- if (_opt.diff.vehicle_breakdowns < 1) return;
-
/* reduced breakdowns? */
if (_opt.diff.vehicle_breakdowns == 1) rel += 0x6666;