From b461dc5fb9a35b040dc626c8931839e430583144 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sat, 26 Nov 2011 14:12:59 +0000 Subject: [PATCH] When restoring temporarily backed up map, clear all TROR bunches. This is suboptimal, but at least 'correct' and won't produce the aforementioned corruptions anymore. git-svn-id: https://svn.eduke32.com/eduke32@2135 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/build.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index 5201a0c4a..5f6633a50 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -1446,6 +1446,7 @@ static int32_t backup_highlighted_map(mapinfofull_t *mapinfo) if (highlightsectorcnt <= 0) return -1; + // set up old-->new mappings j = 0; k = 0; for (i=0; isector = Bmalloc(highlightsectorcnt * sizeof(sectortype)); if (!mapinfo->sector) return -2; + mapinfo->wall = Bmalloc(tmpnumwalls * sizeof(walltype)); if (!mapinfo->wall) { Bfree(mapinfo->sector); return -2; } + if (tmpnumsprites>0) { mapinfo->sprite = Bmalloc(tmpnumsprites * sizeof(spritetype)); @@ -1496,6 +1499,11 @@ static int32_t backup_highlighted_map(mapinfofull_t *mapinfo) return -2; } } + else + { + // would never be accessed because mapinfo->numsprites is 0, but cleaner + mapinfo->sprite = NULL; + } // copy everything over @@ -1596,7 +1604,12 @@ static int32_t restore_highlighted_map(mapinfofull_t *mapinfo) Bmemset(hlsectorbitmap, 0, sizeof(hlsectorbitmap)); for (i=onumsectors; i>3] |= (1<<(i&7)); +#ifdef YAX_ENABLE + yax_setbunches(i, -1, -1); +#endif + } // insert sprites for (i=0; inumsprites; i++)