From ba629379ca7b610ef3d3a3a7adef11080e085bce Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 30 Jan 2017 00:25:40 +0100 Subject: [PATCH] - fixed: for levels with 0-length lines the allocation size of the lines array was too large because it didn't subtract those deleted lines. --- src/p_setup.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index e2dee7cf1..df41345f4 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -2093,9 +2093,7 @@ void P_LoadLineDefs (MapData * map) maplinedef_t *mld; int numlines = lumplen / sizeof(maplinedef_t); - level.lines.Alloc(numlines); linemap.Resize(numlines); - memset (&level.lines[0], 0, numlines*sizeof(line_t)); mldf = new char[lumplen]; map->Read(ML_LINEDEFS, mldf); @@ -2140,6 +2138,8 @@ void P_LoadLineDefs (MapData * map) i++; } } + level.lines.Alloc(numlines); + memset(&level.lines[0], 0, numlines * sizeof(line_t)); P_AllocateSideDefs (map, sidecount); @@ -2192,9 +2192,7 @@ void P_LoadLineDefs2 (MapData * map) maplinedef2_t *mld; int numlines = lumplen / sizeof(maplinedef2_t); - level.lines.Alloc(numlines); linemap.Resize(numlines); - memset (&level.lines[0], 0, numlines*sizeof(line_t)); mldf = new char[lumplen]; map->Read(ML_LINEDEFS, mldf); @@ -2233,6 +2231,8 @@ void P_LoadLineDefs2 (MapData * map) { ForceNodeBuild = true; } + level.lines.Alloc(numlines); + memset(&level.lines[0], 0, numlines * sizeof(line_t)); P_AllocateSideDefs (map, sidecount);