summaryrefslogtreecommitdiff
path: root/src/pathfinder
diff options
context:
space:
mode:
Diffstat (limited to 'src/pathfinder')
-rw-r--r--src/pathfinder/follow_track.hpp6
-rw-r--r--src/pathfinder/npf/npf.cpp6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/pathfinder/follow_track.hpp b/src/pathfinder/follow_track.hpp
index 33e861c41..70660d653 100644
--- a/src/pathfinder/follow_track.hpp
+++ b/src/pathfinder/follow_track.hpp
@@ -160,9 +160,9 @@ struct CFollowTrackT
/* Mask already reserved trackdirs. */
m_new_td_bits &= ~TrackBitsToTrackdirBits(reserved);
/* Mask out all trackdirs that conflict with the reservation. */
- int i;
- FOR_EACH_SET_BIT(i, TrackdirBitsToTrackBits(m_new_td_bits)) {
- if (TracksOverlap(reserved | TrackToTrackBits((Track)i))) m_new_td_bits &= ~TrackToTrackdirBits((Track)i);
+ Track t;
+ FOR_EACH_SET_TRACK(t, TrackdirBitsToTrackBits(m_new_td_bits)) {
+ if (TracksOverlap(reserved | TrackToTrackBits(t))) m_new_td_bits &= ~TrackToTrackdirBits(t);
}
if (m_new_td_bits == TRACKDIR_BIT_NONE) {
m_err = EC_RESERVED;
diff --git a/src/pathfinder/npf/npf.cpp b/src/pathfinder/npf/npf.cpp
index 05ff2f4b0..1e656e547 100644
--- a/src/pathfinder/npf/npf.cpp
+++ b/src/pathfinder/npf/npf.cpp
@@ -921,9 +921,9 @@ static void NPFFollowTrack(AyStar *aystar, OpenListNode *current)
TrackBits reserved = GetReservedTrackbits(dst_tile);
trackdirbits &= ~TrackBitsToTrackdirBits(reserved);
- int i;
- FOR_EACH_SET_BIT(i, TrackdirBitsToTrackBits(trackdirbits)) {
- if (TracksOverlap(reserved | TrackToTrackBits((Track)i))) trackdirbits &= ~TrackToTrackdirBits((Track)i);
+ Track t;
+ FOR_EACH_SET_TRACK(t, TrackdirBitsToTrackBits(trackdirbits)) {
+ if (TracksOverlap(reserved | TrackToTrackBits(t))) trackdirbits &= ~TrackToTrackdirBits(t);
}
}