summaryrefslogtreecommitdiff
path: root/src/rail_cmd.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-07-24 10:14:39 +0000
committeralberth <alberth@openttd.org>2010-07-24 10:14:39 +0000
commitbe6c0584240caf420b2475a0be036391e842e8af (patch)
tree6111751cf5526e1eb41176782d84766c4e9ed185 /src/rail_cmd.cpp
parent645b6ce77345867fa96861843197481131566c46 (diff)
downloadopenttd-be6c0584240caf420b2475a0be036391e842e8af.tar.xz
(svn r20211) -Codechange: Indented code should have curly braces around it.
Diffstat (limited to 'src/rail_cmd.cpp')
-rw-r--r--src/rail_cmd.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp
index eedfe7546..e866046a5 100644
--- a/src/rail_cmd.cpp
+++ b/src/rail_cmd.cpp
@@ -562,8 +562,9 @@ CommandCost CmdRemoveSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1,
cost.AddCost(RailClearCost(GetRailType(tile)));
/* Charge extra to remove signals on the track, if they are there */
- if (HasSignalOnTrack(tile, track))
+ if (HasSignalOnTrack(tile, track)) {
cost.AddCost(DoCommand(tile, track, 0, flags, CMD_REMOVE_SIGNALS));
+ }
if (flags & DC_EXEC) {
if (HasReservedTracks(tile, trackbit)) {
@@ -703,12 +704,10 @@ static CommandCost ValidateAutoDrag(Trackdir *trackdir, TileIndex start, TileInd
}
/* validate the direction */
- while (
- (trdx <= 0 && dx > 0) ||
- (trdx >= 0 && dx < 0) ||
- (trdy <= 0 && dy > 0) ||
- (trdy >= 0 && dy < 0)
- ) {
+ while ((trdx <= 0 && dx > 0) ||
+ (trdx >= 0 && dx < 0) ||
+ (trdy <= 0 && dy > 0) ||
+ (trdy >= 0 && dy < 0)) {
if (!HasBit(*trackdir, 3)) { // first direction is invalid, try the other
SetBit(*trackdir, 3); // reverse the direction
trdx = -trdx;