Heya
I've been having trouble with my bots not adding ALL of the available player models to their list of available models to select.
I found a "bug" in the FindDirectory code of good ol' botman's directory searching I used from HPB_bot code.
The bug is that it kept skipping some directories with me, and did not work as expected.
this
Code:
while ( pFindFileData.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY )
{
if (FindNextFile(hFile, &pFindFileData) == 0)
{
FindClose(hFile);
hFile = NULL;
return hFile;
}
}
should be this
Code:
while ( (pFindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY )
{
if (FindNextFile(hFile, &pFindFileData) == 0)
{
FindClose(hFile);
hFile = NULL;
return hFile;
}
}
it didn't take into account that a directory could have several more flags set on it (e.g. Read only/Archived etc)
ps you need to update two of these in the FindDirectory() function...
(

) 8D