]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix crash when loading .dpm models
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 16 Apr 2006 11:37:07 +0000 (11:37 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 16 Apr 2006 11:37:07 +0000 (11:37 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6297 d7cf8633-e32d-0410-b094-e92efae38249

model_alias.c

index d8ebba5b2bfaa01a0913c202eb66199b981e6de3..beb9b00f044be5847e15d4ef68f8f722de62c35d 100644 (file)
@@ -1524,15 +1524,14 @@ void Mod_DARKPLACESMODEL_Load(model_t *mod, void *buffer, void *bufferend)
        meshtriangles = 0;
        numvertexboneweights = 0;
 
-       // load the meshes now
+       // gather combined statistics from the meshes
        dpmmesh = (dpmmesh_t *) (pbase + pheader->ofs_meshs);
-       for (i = 0;i < loadmodel->num_surfaces;i++)
+       for (i = 0;i < (int)pheader->num_meshs;i++)
        {
                int numverts = BigLong(dpmmesh->num_verts);
                meshvertices += numverts;;
                meshtriangles += BigLong(dpmmesh->num_tris);
 
-               // to find out how many weights exist we two a two-stage load...
                data = (unsigned char *) (pbase + BigLong(dpmmesh->ofs_verts));
                for (j = 0;j < numverts;j++)
                {