shithub: choc

Download patch

ref: 089ab59dff793780c3c9f4963b7c62bce0d6a9b4
parent: 621a8d8362856fbd4627f81f14a00e19aee0744f
author: Thomas A. Birkel <[email protected]>
date: Sun Nov 20 06:13:50 EST 2016

g_game.c: Don't overwrite Heretic/Hexen timedemo arguments

Same as commit 621a8d8 but changing G_TimeDemo().

Additional fix for #803

--- a/src/heretic/g_game.c
+++ b/src/heretic/g_game.c
@@ -1921,9 +1921,11 @@
     map = *demo_p++;
 
     // Read special parameter bits: see G_RecordDemo() for details.
-    respawnparm = (*demo_p & DEMOHEADER_RESPAWN) != 0;
-    longtics    = (*demo_p & DEMOHEADER_LONGTICS) != 0;
-    nomonsters  = (*demo_p & DEMOHEADER_NOMONSTERS) != 0;
+    longtics = (*demo_p & DEMOHEADER_LONGTICS) != 0;
+
+    // don't overwrite arguments from the command line
+    respawnparm |= (*demo_p & DEMOHEADER_RESPAWN) != 0;
+    nomonsters  |= (*demo_p & DEMOHEADER_NOMONSTERS) != 0;
 
     for (i = 0; i < MAXPLAYERS; i++)
     {
--- a/src/hexen/g_game.c
+++ b/src/hexen/g_game.c
@@ -2091,9 +2091,11 @@
     map = *demo_p++;
 
     // Read special parameter bits: see G_RecordDemo() for details.
-    respawnparm = (*demo_p & DEMOHEADER_RESPAWN) != 0;
-    longtics    = (*demo_p & DEMOHEADER_LONGTICS) != 0;
-    nomonsters  = (*demo_p & DEMOHEADER_NOMONSTERS) != 0;
+    longtics = (*demo_p & DEMOHEADER_LONGTICS) != 0;
+
+    // don't overwrite arguments from the command line
+    respawnparm |= (*demo_p & DEMOHEADER_RESPAWN) != 0;
+    nomonsters  |= (*demo_p & DEMOHEADER_NOMONSTERS) != 0;
 
     for (i = 0; i < maxplayers; i++)
     {