It seems like the module used for extracting .RAR archives only supports some types of them. When it fails to extract, the failure never gets passed to the plugin which continues trying to handle the newly extracted files (that don't exist).
To prevent this from happening, you'd need to add a check to make sure the files actually exist after extraction.
Changing this:
PHP Code:
public bool:is_valid_demo_file( file )
{
fseek( file, 0, SEEK_END );
new header_size = ftell( file );
if ( header_size < 544 )
{
return(false);
}
fseek( file, 0, SEEK_SET );
new signature[6];
fread_blocks( file, signature, sizeof(signature), BLOCK_CHAR );
if ( !contain( "HLDEMO", signature ) )
{
return(false);
}
return(true);
}
... to this:
PHP Code:
public bool:is_valid_demo_file( file )
{
if ( !file )
{
return(false);
}
fseek( file, 0, SEEK_END );
new header_size = ftell( file );
if ( header_size < 544 )
{
return(false);
}
fseek( file, 0, SEEK_SET );
new signature[6];
fread_blocks( file, signature, sizeof(signature), BLOCK_CHAR );
if ( !contain( "HLDEMO", signature ) )
{
return(false);
}
return(true);
}
should do the job.
If your goal is to make the bot work for all maps though, I'm afraid it's much more complicated than that, since AFAIK there are no other modules for extracting archives, so you'd need to develop one that works for all RAR types yourself. Either that, or repackage all the bad demos into the default RAR format.