diff options
author | rubidium <rubidium@openttd.org> | 2010-05-11 20:48:06 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-05-11 20:48:06 +0000 |
commit | be504a6ef0f26b78216699d6995ccc8dee02a5c1 (patch) | |
tree | 97bb83daf3620edf7a128da731e3e43d450d359d /src/pathfinder/npf | |
parent | 26bf9a13deea2da71142a6259ede951e08e75d01 (diff) | |
download | openttd-be504a6ef0f26b78216699d6995ccc8dee02a5c1.tar.xz |
(svn r19788) -Codechange: make FOR_EACH_SET_BIT not change the value of the passed bit variable, i.e. allow expressions as parameter
Diffstat (limited to 'src/pathfinder/npf')
-rw-r--r-- | src/pathfinder/npf/npf.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/pathfinder/npf/npf.cpp b/src/pathfinder/npf/npf.cpp index b239d5c52..05ff2f4b0 100644 --- a/src/pathfinder/npf/npf.cpp +++ b/src/pathfinder/npf/npf.cpp @@ -921,9 +921,8 @@ static void NPFFollowTrack(AyStar *aystar, OpenListNode *current) TrackBits reserved = GetReservedTrackbits(dst_tile); trackdirbits &= ~TrackBitsToTrackdirBits(reserved); - uint bits = TrackdirBitsToTrackBits(trackdirbits); int i; - FOR_EACH_SET_BIT(i, bits) { + FOR_EACH_SET_BIT(i, TrackdirBitsToTrackBits(trackdirbits)) { if (TracksOverlap(reserved | TrackToTrackBits((Track)i))) trackdirbits &= ~TrackToTrackdirBits((Track)i); } } |