Mercurial > hg > openttd
changeset 6004:87e8370b2fe7 draft
(svn r8725) -Fix (r8712): test the first bit of the bitmask, not the nth, as we are shifting the bitmask.
author | rubidium <rubidium@openttd.org> |
---|---|
date | Wed, 14 Feb 2007 09:23:52 +0000 |
parents | 163079a36a23 |
children | 0a5324533569 |
files | src/roadveh_cmd.cpp |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -1202,7 +1202,7 @@ 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;