]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix a crash when loading q3 maps with flares
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 14 May 2005 05:17:19 +0000 (05:17 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 14 May 2005 05:17:19 +0000 (05:17 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5294 d7cf8633-e32d-0410-b094-e92efae38249

model_brush.c

index d5d7591e43e2f92dc701a5d07b80a45a17642f5a..443bb23c03ece6f70569194b408daf953826a052 100644 (file)
@@ -5504,7 +5504,8 @@ void Mod_Q3BSP_Load(model_t *mod, void *buffer)
        }
        loadmodel->brush.shadowmesh = Mod_ShadowMesh_Begin(loadmodel->mempool, numshadowmeshtriangles * 3, numshadowmeshtriangles, NULL, NULL, NULL, false, false, true);
        for (j = 0, surface = loadmodel->data_surfaces;j < loadmodel->num_surfaces;j++, surface++)
-               Mod_ShadowMesh_AddMesh(loadmodel->mempool, loadmodel->brush.shadowmesh, NULL, NULL, NULL, surface->groupmesh->data_vertex3f, NULL, NULL, NULL, NULL, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
+               if (surface->groupmesh)
+                       Mod_ShadowMesh_AddMesh(loadmodel->mempool, loadmodel->brush.shadowmesh, NULL, NULL, NULL, surface->groupmesh->data_vertex3f, NULL, NULL, NULL, NULL, surface->num_triangles, (surface->groupmesh->data_element3i + 3 * surface->num_firsttriangle));
        loadmodel->brush.shadowmesh = Mod_ShadowMesh_Finish(loadmodel->mempool, loadmodel->brush.shadowmesh, false, true);
        Mod_BuildTriangleNeighbors(loadmodel->brush.shadowmesh->neighbor3i, loadmodel->brush.shadowmesh->element3i, loadmodel->brush.shadowmesh->numtriangles);