Game: write numbered demo files, fix infinite loop after finished demo playback

git-svn-id: https://svn.eduke32.com/eduke32@1067 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2008-09-14 21:25:23 +00:00
parent 746071a4f4
commit ca763dafad

View file

@ -11174,6 +11174,7 @@ MAIN_LOOP_RESTART:
if (ud.warp_on == 0 && playback())
{
ud.multimode = numplayers; // fixes playback() infinite loop after watching demo
FX_StopAllSounds();
clearsoundlocks();
g_NoLogoAnim = 1;
@ -11431,8 +11432,8 @@ corrupt:
void opendemowrite(void)
{
char *d = "demo1.dmo";
int dummylong = 0;
char d[13];
int dummylong = 0, demonum=1;
char ver;
short i;
@ -11440,6 +11441,15 @@ void opendemowrite(void)
ver = BYTEVERSION;
while (1)
{
if (demonum == 10000) return;
Bsprintf(d, "demo%d.dmo", demonum++);
frecfilep = fopen(d, "rb");
if (frecfilep == NULL) break;
Bfclose(frecfilep);
}
if ((frecfilep = fopen(d,"wb")) == NULL) return;
fwrite(&dummylong,4,1,frecfilep);
fwrite(&ver,sizeof(char),1,frecfilep);