summaryrefslogtreecommitdiff
path: root/src/rail_cmd.cpp
diff options
context:
space:
mode:
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;