mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-21 01:41:10 +00:00
Fix bsp2 loading.
Just some problems with the handling of extended bsp29 files. I'm not quite happy with the code, but it will do for now.
This commit is contained in:
parent
cfb856b9cf
commit
45c48a6215
1 changed files with 5 additions and 5 deletions
|
@ -600,10 +600,13 @@ Mod_LoadNodes (bsp_t *bsp)
|
|||
for (j = 0; j < 2; j++) {
|
||||
p = in->children[j];
|
||||
// this check is for extended bsp 29 files
|
||||
if (p < count) {
|
||||
if (p >= 0 && p < count) {
|
||||
out->children[j] = loadmodel->nodes + p;
|
||||
} else {
|
||||
p = 65535 - p; //NOTE this uses 65535 intentionally, -1 is leaf
|
||||
if (p >= count)
|
||||
p = 65535 - p; //NOTE 65535 is intentional, -1 is leaf
|
||||
else
|
||||
p = ~p;
|
||||
if (p < loadmodel->numleafs) {
|
||||
out->children[j] = (mnode_t *) (loadmodel->leafs + p);
|
||||
} else {
|
||||
|
@ -632,9 +635,6 @@ Mod_LoadLeafs (bsp_t *bsp)
|
|||
count = bsp->numleafs;
|
||||
out = Hunk_AllocName (count * sizeof (*out), loadname);
|
||||
|
||||
if (count > 32767)
|
||||
Sys_Error ("%i leafs exceeds limit of 32767.\n", count);
|
||||
|
||||
loadmodel->leafs = out;
|
||||
loadmodel->numleafs = count;
|
||||
// snprintf(s, sizeof (s), "maps/%s.bsp",
|
||||
|
|
Loading…
Reference in a new issue