From 85376ebe25743a98c97994f8a658566f65898d68 Mon Sep 17 00:00:00 2001 From: Lactozilla Date: Wed, 5 Jun 2024 18:18:02 -0300 Subject: [PATCH] Fix #1153 --- src/p_setup.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index c4b4a35b3..b8fcf6b71 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -3502,7 +3502,6 @@ static boolean P_LoadExtraVertices(UINT8 **data) UINT32 xtrvrtx = READUINT32((*data)); line_t* ld = lines; vertex_t *oldpos = vertexes; - ssize_t offset; size_t i; if (numvertexes != origvrtx) // If native vertex count doesn't match node original vertex count, bail out (broken data?). @@ -3517,12 +3516,11 @@ static boolean P_LoadExtraVertices(UINT8 **data) // If extra vertexes were generated, reallocate the vertex array and fix the pointers. numvertexes += xtrvrtx; vertexes = Z_Realloc(vertexes, numvertexes*sizeof(*vertexes), PU_LEVEL, NULL); - offset = (size_t)(vertexes - oldpos); for (i = 0, ld = lines; i < numlines; i++, ld++) { - ld->v1 += offset; - ld->v2 += offset; + ld->v1 = &vertexes[ld->v1 - oldpos]; + ld->v2 = &vertexes[ld->v2 - oldpos]; } // Read extra vertex data.