summaryrefslogtreecommitdiff
path: root/src/train_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r--src/train_cmd.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index 99098c44f..fc8ec0253 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -3517,11 +3517,8 @@ static void DeleteLastWagon(Train *v)
/* It is important that these two are the first in the loop, as reservation cannot deal with every trackbit combination */
assert(TRACK_BEGIN == TRACK_X && TRACK_Y == TRACK_BEGIN + 1);
- for (Track t = TRACK_BEGIN; t < TRACK_END; t++) {
- if (HasBit(remaining_trackbits, t)) {
- TryReserveRailTrack(tile, t);
- }
- }
+ Track t;
+ FOR_EACH_SET_TRACK(t, remaining_trackbits) TryReserveRailTrack(tile, t);
}
/* check if the wagon was on a road/rail-crossing */