barf when given a bsp file instead of a map file (and don't zap the bsp file

in the process!!!)
This commit is contained in:
Bill Currie 2003-08-11 20:43:26 +00:00
parent fa31cb73b5
commit 19cf019ed2
2 changed files with 8 additions and 7 deletions

View file

@ -32,6 +32,7 @@ static __attribute__ ((unused)) const char rcsid[] =
#endif
#include <stdlib.h>
#include <errno.h>
#include <ctype.h>
#include "QF/dstring.h"
#include "QF/quakefs.h"
@ -133,15 +134,15 @@ TokenAvailable (qboolean crossline)
if (unget)
return true;
skipspace:
while (*script_p <= 32) {
if (!*script_p)
return false;
while (isspace ((unsigned char) *script_p)) {
if (*script_p++ == '\n') {
if (!crossline)
return false;
scriptline++;
}
}
if (!*script_p)
return false;
if (script_p[0] == '/' && script_p[1] == '/') { // comment field
while (*script_p && *script_p != '\n')
@ -186,7 +187,7 @@ GetToken (qboolean crossline)
}
script_p++;
} else
while (*script_p > 32) {
while (*script_p && !isspace ((unsigned char) *script_p)) {
*token_p++ = *script_p++;
if (token_p > &token[MAXTOKEN - 1])
Sys_Error ("Token too large on line %i", scriptline);

View file

@ -789,6 +789,9 @@ ProcessFile (void)
QFS_StripExtension (options.bspfile, options.pointfile);
strcat (options.pointfile, ".pts");
bsp = BSP_New ();
// load brushes and entities
LoadMapFile (options.mapfile);
if (!options.onlyents) {
remove (options.bspfile);
@ -801,9 +804,6 @@ ProcessFile (void)
remove (options.portfile);
remove (options.pointfile);
}
bsp = BSP_New ();
// load brushes and entities
LoadMapFile (options.mapfile);
if (options.onlyents) {
UpdateEntLump ();
return;