From c030768d719328118ef42993eacb0df39c3c7c53 Mon Sep 17 00:00:00 2001 From: terminx Date: Thu, 1 Oct 2009 00:50:20 +0000 Subject: [PATCH] More corrupt map fixes fuck ebase.map git-svn-id: https://svn.eduke32.com/eduke32@1511 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/polymer.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index 16be74f50..7cc0c5f25 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -2936,13 +2936,15 @@ static void polymer_updatewall(int16_t wallnum) if (sectofwall < 0 || sectofwall > numsectors || wallnum < 0 || wallnum > numwalls) return; // yay, corrupt map + sec = §or[sectofwall]; if (sec->wallptr > wallnum) return; // the map is horribly corrupt + w = prwalls[wallnum]; s = prsectors[sectofwall]; invalid = s->invalidid; - if (nwallnum >= 0 && nwallnum < MAXWALLS) + if (nwallnum >= 0 && nwallnum < numwalls) { ns = prsectors[wal->nextsector]; invalid += ns->invalidid; @@ -2963,7 +2965,7 @@ static void polymer_updatewall(int16_t wallnum) if (picanm[wallpicnum]&192) wallpicnum += animateoffs(wallpicnum,wallnum+16384); walloverpicnum = wal->overpicnum; if (picanm[walloverpicnum]&192) walloverpicnum += animateoffs(walloverpicnum,wallnum+16384); - if (nwallnum >= 0 && nwallnum < MAXWALLS) + if (nwallnum >= 0 && nwallnum < numwalls) { nwallpicnum = wall[nwallnum].picnum; if (picanm[nwallpicnum]&192) nwallpicnum += animateoffs(nwallpicnum,wallnum+16384); @@ -2982,7 +2984,7 @@ static void polymer_updatewall(int16_t wallnum) (wal->yrepeat == w->yrepeat) && (walloverpicnum == w->overpicnum) && (wal->shade == w->shade) && - ((nwallnum == -1) || + ((nwallnum < 0 || nwallnum > numwalls) || ((nwallpicnum == w->nwallpicnum) && (wall[nwallnum].xpanning == w->nwallxpanning) && (wall[nwallnum].ypanning == w->nwallypanning) && @@ -3006,7 +3008,7 @@ static void polymer_updatewall(int16_t wallnum) w->yrepeat = wal->yrepeat; w->overpicnum = walloverpicnum; w->shade = wal->shade; - if (nwallnum >= 0 && nwallnum < MAXWALLS) + if (nwallnum >= 0 && nwallnum < numwalls) { w->nwallpicnum = nwallpicnum; w->nwallxpanning = wall[nwallnum].xpanning;