summaryrefslogtreecommitdiff
path: root/src/pathfinder
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-05-11 21:02:26 +0000
committerrubidium <rubidium@openttd.org>2010-05-11 21:02:26 +0000
commit99ecfe4061f8e6404e18f5fcef7cdb13990fb252 (patch)
treeff8efd450c34ac3fdc6e1a3e62316a54a70c2573 /src/pathfinder
parentfe71d4fc99aa74c504de0ce3c80cb318903bddf7 (diff)
downloadopenttd-99ecfe4061f8e6404e18f5fcef7cdb13990fb252.tar.xz
(svn r19792) -Change: use the typed FOR_EACH_SET_BIT for Tracks (adf88)
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);
}
}