Fix #3064
authorTon Roosendaal <ton@blender.org>
Mon, 21 Nov 2005 17:06:16 +0000 (17:06 +0000)
committerTon Roosendaal <ton@blender.org>
Mon, 21 Nov 2005 17:06:16 +0000 (17:06 +0000)
Assigning a Hook in Mesh editmode to new created vertices crashed on
exit editmode.

source/blender/src/editmesh.c

index 37641c736c1475fa1088afe310722c9d804e856c..5a354b5e0020a1cec0933b3033e4cc90dee93ba5 100644 (file)
@@ -1100,11 +1100,14 @@ void load_editMesh(void)
                                                }
                                                
                                                for (i=j=0; i<hmd->totindex; i++) {
-                                                       eve = vertMap[hmd->indexar[i]];
-                                                       
-                                                       if (eve) {
-                                                               hmd->indexar[j++] = (long) eve->vn;
+                                                       if(hmd->indexar[i] < ototvert) {
+                                                               eve = vertMap[hmd->indexar[i]];
+                                                               
+                                                               if (eve) {
+                                                                       hmd->indexar[j++] = (long) eve->vn;
+                                                               }
                                                        }
+                                                       else j++;
                                                }
 
                                                hmd->totindex = j;