From 12720de8bdac698b69865445aa5b0753cfcd76b2 Mon Sep 17 00:00:00 2001
From: lordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Sun, 19 May 2002 01:30:53 +0000
Subject: [PATCH] fix for really dumb mistake (missing memset) in
 Mod_SplitSurfMeshIfTooBig

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@1852 d7cf8633-e32d-0410-b094-e92efae38249
---
 model_brush.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/model_brush.c b/model_brush.c
index 5aecaa77..be7c3067 100644
--- a/model_brush.c
+++ b/model_brush.c
@@ -1239,7 +1239,6 @@ static void Mod_SplitSurfMeshIfTooBig(msurface_t *s)
 	if (s->mesh->numtriangles > 1000)
 	{
 		vertexremap = Mem_Alloc(tempmempool, s->mesh->numverts * sizeof(int));
-		memset(vertexremap, -1, s->mesh->numverts * sizeof(int));
 		base = 0;
 		oldmesh = NULL;
 		firstmesh = NULL;
@@ -1253,6 +1252,7 @@ static void Mod_SplitSurfMeshIfTooBig(msurface_t *s)
 			base += tricount;
 
 			newvertexcount = 0;
+			memset(vertexremap, -1, s->mesh->numverts * sizeof(int));
 			for (j = 0;j < tricount * 3;j++)
 				if (vertexremap[index[j]] < 0)
 					vertexremap[index[j]] = newvertexcount++;
-- 
2.39.5