From f3dc5596ad3b0e77819e78cc9ee803364d43a7c7 Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 14 Feb 2007 09:23:52 +0000 Subject: [PATCH] (svn r8725) -Fix (r8712): test the first bit of the bitmask, not the nth, as we are shifting the bitmask. --- src/roadveh_cmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 6c923c9c18..82b8b3bc86 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -1202,7 +1202,7 @@ do_it:; uint best_maxlen = (uint)-1; uint bitmask = (uint)trackdirs; for (int i = 0; bitmask != 0; bitmask >>= 1, i++) { - if (HASBIT(bitmask, i)) { + if (HASBIT(bitmask, 0)) { if (best_track == INVALID_TRACKDIR) best_track = (Trackdir)i; // in case we don't find the path, just pick a track frd.maxtracklen = (uint)-1; frd.mindist = (uint)-1;