View Single Post
Re: Important! :P Player Model Search bug fix
Old
  (#3)
Austin
Moderator
 
Austin's Avatar
 
Status: Offline
Posts: 403
Join Date: Nov 2003
Default Re: Important! :P Player Model Search bug fix - 04-06-2004

Quote:
Originally Posted by Cheeseh
Heya
I found a "bug" in the FindDirectory code of good ol' botman's directory searching I used from HPB_bot code.

should be this
Code:
while ( (pFindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY )
Well.. not quite..
It MAY work but this would be by-chance.

dwFileAttributes is a bit mask and we are testing for the bit
FILE_ATTRIBUTE_DIRECTORY,

Thus we AND them but then TEST FOR 0 OR NON 0.

if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
//code looking for files go here..

if ((fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
// code looking for dirs go here..

>edit<
Yup, yup, you guys are correct.
Either way will work, but if you want to use positive logic you have to do it your way.

Last edited by Austin; 06-06-2004 at 19:15..
  
Reply With Quote