Merge pull request #576 from tkoeppe/bugfixes

Bugfixes in sciptlib.c and map.c
This commit is contained in:
Timothee "TTimo" Besset 2018-01-20 15:35:53 -06:00 committed by GitHub
commit 3c49dd161d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View file

@ -58,6 +58,7 @@ qboolean tokenready; // only qtrue if UnGetToken was just ca
*/ */
void AddScriptToStack( const char *filename, int index ){ void AddScriptToStack( const char *filename, int index ){
int size; int size;
void* buffer;
script++; script++;
if ( script == &scriptstack[MAX_INCLUDES] ) { if ( script == &scriptstack[MAX_INCLUDES] ) {
@ -65,10 +66,11 @@ void AddScriptToStack( const char *filename, int index ){
} }
strcpy( script->filename, ExpandPath( filename ) ); strcpy( script->filename, ExpandPath( filename ) );
size = vfsLoadFile( script->filename, (void **)&script->buffer, index ); size = vfsLoadFile( script->filename, &buffer, index );
if ( size == -1 ) { if ( size == -1 ) {
Sys_Printf( "Script file %s was not found\n", script->filename ); Sys_Printf( "Script file %s was not found\n", script->filename );
script--;
} }
else else
{ {
@ -78,11 +80,12 @@ void AddScriptToStack( const char *filename, int index ){
else{ else{
Sys_Printf( "entering %s\n", script->filename ); Sys_Printf( "entering %s\n", script->filename );
} }
}
script->line = 1; script->buffer = buffer;
script->script_p = script->buffer; script->line = 1;
script->end_p = script->buffer + size; script->script_p = script->buffer;
script->end_p = script->buffer + size;
}
} }

View file

@ -1086,7 +1086,7 @@ static void ParseRawBrush( qboolean onlyLights ){
side->planenum = planenum; side->planenum = planenum;
/* bp: get the texture mapping for this texturedef / plane combination */ /* bp: get the texture mapping for this texturedef / plane combination */
if ( g_bBrushPrimit == BPRIMIT_OLDBRUSHES ) { if ( g_bBrushPrimit == BPRIMIT_OLDBRUSHES && planenum != -1 ) {
QuakeTextureVecs( &mapplanes[ planenum ], shift, rotate, scale, side->vecs ); QuakeTextureVecs( &mapplanes[ planenum ], shift, rotate, scale, side->vecs );
} }
} }