From 3b634f28aede332575633e5d22919f942bf0acd7 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Mon, 12 Sep 2011 15:03:51 +0000 Subject: [PATCH] fix a couple of editor issues: - one reported by Micky: http://forums.duke4.net/topic/3911-true-room-over-room/page__view__findpost__p__106610 - malloc(0) call when saving a map with no sprites - update 'asksave' after Alt-S and corrupt-check on starting a new map git-svn-id: https://svn.eduke32.com/eduke32@2017 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/build.c | 7 ++++ polymer/eduke32/build/src/engine.c | 66 +++++++++++++++--------------- 2 files changed, 41 insertions(+), 32 deletions(-) diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index 5d05cebd5..bd41cfede 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -5300,6 +5300,10 @@ end_join_sectors: { NEXTWALL(i).nextwall = i; NEXTWALL(i).nextsector = numsectors; +#ifdef YAX_ENABLE + yax_setnextwall(i, YAX_CEILING, -1); + yax_setnextwall(i, YAX_FLOOR, -1); +#endif } #ifdef YAX_ENABLE yax_setbunches(numsectors, -1, -1); @@ -5310,6 +5314,7 @@ end_join_sectors: newnumwalls = -1; numsectors++; + asksave = 1; printmessage16("Inner loop made into new sector."); } } @@ -6555,6 +6560,8 @@ CANCEL: message("Can't copy highlighted portion of old map: limits exceeded."); } + CheckMapCorruption(4, 0); + break; } diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 79bfdd896..0802c3d38 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -9743,40 +9743,42 @@ int32_t saveboard(const char *filename, int32_t *daposx, int32_t *daposy, int32_ ts = B_LITTLE16(numsprites); Bwrite(fil,&ts,2); - tspri = (spritetype *)Bmalloc(sizeof(spritetype) * numsprites); - - if (tspri == NULL) - break; - - - spri=tspri; - - for (j=0; j 0) { - if (sprite[j].statnum != MAXSTATUS) - { - Bmemcpy(spri,&sprite[j],sizeof(spritetype)); - spri->x = B_LITTLE32(spri->x); - spri->y = B_LITTLE32(spri->y); - spri->z = B_LITTLE32(spri->z); - spri->cstat = B_LITTLE16(spri->cstat); - spri->picnum = B_LITTLE16(spri->picnum); - spri->sectnum = B_LITTLE16(spri->sectnum); - spri->statnum = B_LITTLE16(spri->statnum); - spri->ang = B_LITTLE16(spri->ang); - spri->owner = B_LITTLE16(spri->owner); - spri->xvel = B_LITTLE16(spri->xvel); - spri->yvel = B_LITTLE16(spri->yvel); - spri->zvel = B_LITTLE16(spri->zvel); - spri->lotag = B_LITTLE16(spri->lotag); - spri->hitag = B_LITTLE16(spri->hitag); - spri->extra = B_LITTLE16(spri->extra); - spri++; - } - } + tspri = (spritetype *)Bmalloc(sizeof(spritetype) * numsprites); - Bwrite(fil,&tspri[0],sizeof(spritetype) * numsprites); - Bfree(tspri); + if (tspri == NULL) + break; + + spri=tspri; + + for (j=0; jx = B_LITTLE32(spri->x); + spri->y = B_LITTLE32(spri->y); + spri->z = B_LITTLE32(spri->z); + spri->cstat = B_LITTLE16(spri->cstat); + spri->picnum = B_LITTLE16(spri->picnum); + spri->sectnum = B_LITTLE16(spri->sectnum); + spri->statnum = B_LITTLE16(spri->statnum); + spri->ang = B_LITTLE16(spri->ang); + spri->owner = B_LITTLE16(spri->owner); + spri->xvel = B_LITTLE16(spri->xvel); + spri->yvel = B_LITTLE16(spri->yvel); + spri->zvel = B_LITTLE16(spri->zvel); + spri->lotag = B_LITTLE16(spri->lotag); + spri->hitag = B_LITTLE16(spri->hitag); + spri->extra = B_LITTLE16(spri->extra); + spri++; + } + } + + Bwrite(fil,&tspri[0],sizeof(spritetype) * numsprites); + Bfree(tspri); + } Bclose(fil); return(0);