This commit is contained in:
Shawn Walker 2014-05-18 15:39:41 -07:00
commit d2b0596cd4
4 changed files with 21 additions and 13 deletions

View File

@ -1385,7 +1385,7 @@ bool DoArbitrate (void *userdata)
stream = &netbuffer[4];
s = ReadString (&stream);
startmap = FString(s, 8);
startmap = s;
delete[] s;
rngseed = ReadLong (&stream);
C_ReadCVars (&stream);

View File

@ -2302,11 +2302,10 @@ void G_BeginRecording (const char *startmap)
WriteWord (DEMOGAMEVERSION, &demo_p); // Write ZDoom version
*demo_p++ = 2; // Write minimum version needed to use this demo.
*demo_p++ = 3; // (Useful?)
for (i = 0; i < 8; i++) // Write name of map demo was recorded on.
{
*demo_p++ = startmap[i];
}
WriteLong (rngseed, &demo_p); // Write RNG seed
strcpy((char*)demo_p, startmap); // Write name of map demo was recorded on.
demo_p += strlen(startmap) + 1;
WriteLong(rngseed, &demo_p); // Write RNG seed
*demo_p++ = consoleplayer;
FinishChunk (&demo_p);
@ -2385,7 +2384,7 @@ CCMD (timedemo)
// [RH] Process all the information in a FORM ZDEM
// until a BODY chunk is entered.
bool G_ProcessIFFDemo (char *mapname)
bool G_ProcessIFFDemo (FString &mapname)
{
bool headerHit = false;
bool bodyHit = false;
@ -2441,9 +2440,16 @@ bool G_ProcessIFFDemo (char *mapname)
Printf ("Demo requires a newer version of ZDoom!\n");
return true;
}
memcpy (mapname, demo_p, 8); // Read map name
mapname[8] = 0;
demo_p += 8;
if (demover >= 0x21a)
{
mapname = (char*)demo_p;
demo_p += mapname.Len() + 1;
}
else
{
mapname = FString((char*)demo_p, 8);
demo_p += 8;
}
rngseed = ReadLong (&demo_p);
// Only reset the RNG if this demo is not in conjunction with a savegame.
if (mapname[0] != 0)
@ -2525,7 +2531,7 @@ bool G_ProcessIFFDemo (char *mapname)
void G_DoPlayDemo (void)
{
char mapname[9];
FString mapname;
int demolump;
gameaction = ga_nothing;
@ -2578,7 +2584,7 @@ void G_DoPlayDemo (void)
// don't spend a lot of time in loadlevel
precache = false;
demonew = true;
if (mapname[0] != 0)
if (mapname.Len() != 0)
{
G_InitNew (mapname, false);
}

View File

@ -1410,6 +1410,8 @@ void G_SerializeLevel (FArchive &arc, bool hubLoad)
}
if (arc.IsLoading())
{
sky1texture = level.skytexture1;
sky2texture = level.skytexture2;
R_InitSkyMap();
}

View File

@ -61,7 +61,7 @@ const char *GetVersionString();
// Protocol version used in demos.
// Bump it if you change existing DEM_ commands or add new ones.
// Otherwise, it should be safe to leave it alone.
#define DEMOGAMEVERSION 0x219
#define DEMOGAMEVERSION 0x21A
// Minimum demo version we can play.
// Bump it whenever you change or remove existing DEM_ commands.