+ Host_Error("%s: Corrupt clipping hull(out of range planenum)", loadmodel->name);
+ if (loadmodel->brush.isbsp2)
+ {
+ out->children[0] = MSG_ReadLittleLong(sb);
+ out->children[1] = MSG_ReadLittleLong(sb);
+ if (out->children[0] >= count)
+ Host_Error("%s: Corrupt clipping hull (invalid child index)", loadmodel->name);
+ if (out->children[1] >= count)
+ Host_Error("%s: Corrupt clipping hull (invalid child index)", loadmodel->name);
+ }
+ else
+ {
+ // LordHavoc: this code supports arguire qbsp's broken clipnodes indices (more than 32768 clipnodes), values above count are assumed to be contents values
+ out->children[0] = (unsigned short)MSG_ReadLittleShort(sb);
+ out->children[1] = (unsigned short)MSG_ReadLittleShort(sb);
+ if (out->children[0] >= count)
+ out->children[0] -= 65536;
+ if (out->children[1] >= count)
+ out->children[1] -= 65536;
+ }