]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
don't crash if the model produces no shadowmesh (no geometry)
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 17 Feb 2010 04:22:08 +0000 (04:22 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 17 Feb 2010 04:22:08 +0000 (04:22 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9963 d7cf8633-e32d-0410-b094-e92efae38249

model_brush.c

index aea6997f2046110980f652f42c5ece48672cec89..c2f5320cd12ec5fa29af574d15a9158dadec914e 100644 (file)
@@ -6294,7 +6294,8 @@ void Mod_Q3BSP_Load(dp_model_t *mod, void *buffer, void *bufferend)
                        if (surface->num_triangles > 0)
                                Mod_ShadowMesh_AddMesh(loadmodel->mempool, loadmodel->brush.shadowmesh, NULL, NULL, NULL, loadmodel->surfmesh.data_vertex3f, NULL, NULL, NULL, NULL, surface->num_triangles, (loadmodel->surfmesh.data_element3i + 3 * surface->num_firsttriangle));
                loadmodel->brush.shadowmesh = Mod_ShadowMesh_Finish(loadmodel->mempool, loadmodel->brush.shadowmesh, false, true, false);
-               Mod_BuildTriangleNeighbors(loadmodel->brush.shadowmesh->neighbor3i, loadmodel->brush.shadowmesh->element3i, loadmodel->brush.shadowmesh->numtriangles);
+               if (loadmodel->brush.shadowmesh)
+                       Mod_BuildTriangleNeighbors(loadmodel->brush.shadowmesh->neighbor3i, loadmodel->brush.shadowmesh->element3i, loadmodel->brush.shadowmesh->numtriangles);
        }
 
        loadmodel->brush.num_leafs = 0;