move the node number validation out of RecursiveHullCheck and into the bsp

loader
This commit is contained in:
Bill Currie 2001-07-04 16:28:54 +00:00
parent b1f264b203
commit ce3eddb89c
2 changed files with 7 additions and 4 deletions

View file

@ -747,6 +747,13 @@ Mod_LoadClipnodes (lump_t *l)
out->planenum = LittleLong (in->planenum); out->planenum = LittleLong (in->planenum);
out->children[0] = LittleShort (in->children[0]); out->children[0] = LittleShort (in->children[0]);
out->children[1] = LittleShort (in->children[1]); out->children[1] = LittleShort (in->children[1]);
if ((out->children[0] >= 0
&& (out->children[0] < hull->firstclipnode
|| out->children[0] > hull->lastclipnode))
|| (out->children[1] >= 0
&& (out->children[1] < hull->firstclipnode
|| out->children[1] > hull->lastclipnode)))
Sys_Error ("Mod_LoadClipnodes: bad node number");
} }
} }

View file

@ -207,10 +207,6 @@ PM_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t p1,
trace->startsolid = true; trace->startsolid = true;
return true; // empty return true; // empty
} }
// LordHavoc: this can be eliminated by validating in the loader... but
// Mercury told me not to bother
if (num < hull->firstclipnode || num > hull->lastclipnode)
Sys_Error ("PM_RecursiveHullCheck: bad node number");
// find the point distances // find the point distances
node = hull->clipnodes + num; node = hull->clipnodes + num;