Handle quest format brushes.

Bah, I forgot I needed to fix the vertex count parsing when I did the
script lexing change.
This commit is contained in:
Bill Currie 2012-09-12 08:24:17 +09:00
parent ea541b325d
commit db25d5597d
2 changed files with 22 additions and 6 deletions

View File

@ -643,11 +643,19 @@ ParseVerts (script_t *script, int *n_verts)
{
vec3_t *verts;
int i;
const char *token;
if (strcmp (Script_Token (script), ":"))
token = Script_Token (script);
if (token[0] != ':')
Sys_Error ("parsing map file");
Script_GetToken (script, false);
*n_verts = atoi (Script_Token (script));
// It's normally ":count", but somebody might have done ": count"
if (!token[1]) {
Script_GetToken (script, false);
token = Script_Token (script);
} else {
token++;
}
*n_verts = atoi (token);
verts = malloc (sizeof (vec3_t) * *n_verts);
for (i = 0; i < *n_verts; i++) {

View File

@ -207,11 +207,19 @@ ParseVerts (int *n_verts)
{
vec3_t *verts;
int i;
const char *token;
if (map_script->token->str[0] != ':')
token = Script_Token (map_script);
if (token[0] != ':')
map_error ("parsing brush");
Script_GetToken (map_script, false);
*n_verts = atoi (map_script->token->str);
// It's normally ":count", but somebody might have done ": count"
if (!token[1]) {
Script_GetToken (map_script, false);
token = Script_Token (map_script);
} else {
token++;
}
*n_verts = atoi (token);
verts = malloc (sizeof (vec3_t) * *n_verts);
for (i = 0; i < *n_verts; i++) {