*/
void AddScriptToStack( const char *filename, int index ){
int size;
+ void* buffer;
script++;
if ( script == &scriptstack[MAX_INCLUDES] ) {
}
strcpy( script->filename, ExpandPath( filename ) );
- size = vfsLoadFile( script->filename, (void **)&script->buffer, index );
+ size = vfsLoadFile( script->filename, &buffer, index );
if ( size == -1 ) {
Sys_Printf( "Script file %s was not found\n", script->filename );
+ script--;
}
else
{
else{
Sys_Printf( "entering %s\n", script->filename );
}
- }
- script->line = 1;
- script->script_p = script->buffer;
- script->end_p = script->buffer + size;
+ script->buffer = buffer;
+ script->line = 1;
+ script->script_p = script->buffer;
+ script->end_p = script->buffer + size;
+ }
}