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
This commit is contained in:
helixhorned 2011-09-12 15:03:51 +00:00
parent c698822a41
commit 3b634f28ae
2 changed files with 41 additions and 32 deletions

View file

@ -5300,6 +5300,10 @@ end_join_sectors:
{ {
NEXTWALL(i).nextwall = i; NEXTWALL(i).nextwall = i;
NEXTWALL(i).nextsector = numsectors; NEXTWALL(i).nextsector = numsectors;
#ifdef YAX_ENABLE
yax_setnextwall(i, YAX_CEILING, -1);
yax_setnextwall(i, YAX_FLOOR, -1);
#endif
} }
#ifdef YAX_ENABLE #ifdef YAX_ENABLE
yax_setbunches(numsectors, -1, -1); yax_setbunches(numsectors, -1, -1);
@ -5310,6 +5314,7 @@ end_join_sectors:
newnumwalls = -1; newnumwalls = -1;
numsectors++; numsectors++;
asksave = 1;
printmessage16("Inner loop made into new sector."); printmessage16("Inner loop made into new sector.");
} }
} }
@ -6555,6 +6560,8 @@ CANCEL:
message("Can't copy highlighted portion of old map: limits exceeded."); message("Can't copy highlighted portion of old map: limits exceeded.");
} }
CheckMapCorruption(4, 0);
break; break;
} }

View file

@ -9743,12 +9743,13 @@ int32_t saveboard(const char *filename, int32_t *daposx, int32_t *daposy, int32_
ts = B_LITTLE16(numsprites); Bwrite(fil,&ts,2); ts = B_LITTLE16(numsprites); Bwrite(fil,&ts,2);
if (numsprites > 0)
{
tspri = (spritetype *)Bmalloc(sizeof(spritetype) * numsprites); tspri = (spritetype *)Bmalloc(sizeof(spritetype) * numsprites);
if (tspri == NULL) if (tspri == NULL)
break; break;
spri=tspri; spri=tspri;
for (j=0; j<MAXSPRITES; j++) for (j=0; j<MAXSPRITES; j++)
@ -9777,6 +9778,7 @@ int32_t saveboard(const char *filename, int32_t *daposx, int32_t *daposy, int32_
Bwrite(fil,&tspri[0],sizeof(spritetype) * numsprites); Bwrite(fil,&tspri[0],sizeof(spritetype) * numsprites);
Bfree(tspri); Bfree(tspri);
}
Bclose(fil); Bclose(fil);
return(0); return(0);