Don't validate facet if there is an invalid border plane

The check was missing, which would cause a crash during collision test
This commit is contained in:
smallmodel 2024-12-12 22:34:23 +01:00
parent 1b8ef411ee
commit cd06dc0535
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -766,6 +766,10 @@ static qboolean CM_ValidateFacet( facet_t *facet ) {
Vector4Copy( planes[ facet->surfacePlane ].plane, plane );
w = BaseWindingForPlane( plane, plane[3] );
for ( j = 0 ; j < facet->numBorders && w ; j++ ) {
if ( facet->borderPlanes[j] == -1 ) {
FreeWinding( w );
return qfalse;
}
Vector4Copy( planes[ facet->borderPlanes[j] ].plane, plane );
if ( !facet->borderInward[j] ) {
VectorSubtract( vec3_origin, plane, plane );