maybe better do it like this?
PHP Code:
// if (!StrEqual(buffer,"",false) && !StrEqual(buffer,".",false) && !StrEqual(buffer,"..",false))
if (strlen(buffer) > 4) // if length of contents of the buffer is equal or less than 4 characters, then contents wrong
{
strcopy(tmp_path,255,path);
StrCat(tmp_path,255, "/");
StrCat(tmp_path,255, buffer);
if(type == FileType_File)
{
// if (StrContains(tmp_path, ".bsp") != -1)
if (StrEqual(tmp_path[strlen(tmp_path)-4], ".bsp", false)) // just compare the last 4 characters with the correct extension
// or use: if (StrContains(tmp_path, ".bsp") == strlen(tmp_path)-4)
{
ReplaceString(tmp_path, 255, ".bsp", "");
ReplaceString(tmp_path, 255, "maps/", "");
files.PushString(tmp_path);
}
}
}
__________________