From ff7913ace8156cd8bfda3533f3afcb77897d1646 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 17 May 2014 09:46:58 +0200 Subject: [PATCH 1/4] - fixed: When a level gets loaded the renderer's sky variables need to be set. --- src/g_level.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/g_level.cpp b/src/g_level.cpp index 74a92edb5..8c97a399c 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1410,6 +1410,8 @@ void G_SerializeLevel (FArchive &arc, bool hubLoad) } if (arc.IsLoading()) { + sky1texture = level.skytexture1; + sky2texture = level.skytexture2; R_InitSkyMap(); } From 26b1abe3dab611001b49ce717853b0accd8c5516 Mon Sep 17 00:00:00 2001 From: Edward Richardson Date: Sun, 18 May 2014 18:37:34 +1200 Subject: [PATCH 2/4] Fix netgame arbitration with long map lump names --- src/d_net.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_net.cpp b/src/d_net.cpp index f1b476108..1600d9102 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -1385,7 +1385,7 @@ bool DoArbitrate (void *userdata) stream = &netbuffer[4]; s = ReadString (&stream); - startmap = FString(s, 8); + startmap = FString(s, strlen(s)); delete[] s; rngseed = ReadLong (&stream); C_ReadCVars (&stream); From cfef89486740cdfca0682dcc60caf2b3cdb5bbc9 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 18 May 2014 09:41:13 +0200 Subject: [PATCH 3/4] This can be done better... --- src/d_net.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_net.cpp b/src/d_net.cpp index 1600d9102..60a2b61c4 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -1385,7 +1385,7 @@ bool DoArbitrate (void *userdata) stream = &netbuffer[4]; s = ReadString (&stream); - startmap = FString(s, strlen(s)); + startmap = s; delete[] s; rngseed = ReadLong (&stream); C_ReadCVars (&stream); From 4acc04ce68f37a1340de81f0d754fe8951fa47ca Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 18 May 2014 10:05:35 +0200 Subject: [PATCH 4/4] - don't truncate map names stored in demos. --- src/g_game.cpp | 28 +++++++++++++++++----------- src/version.h | 2 +- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/g_game.cpp b/src/g_game.cpp index 045b331bf..65fa5733d 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -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); } diff --git a/src/version.h b/src/version.h index 1b4457655..8e853057a 100644 --- a/src/version.h +++ b/src/version.h @@ -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.