shithub: choc

Download patch

ref: 226a67f8bf8cb6de3b9f8cf81cd9c674ffbb5347
parent: 406a15b8408a102a29fe5c3e67323aa53d6b56c1
parent: 621a8d8362856fbd4627f81f14a00e19aee0744f
author: Simon Howard <fraggle+github@gmail.com>
date: Fri Nov 11 05:10:54 EST 2016

Merge pull request #804 from CapnClever/raven-demoplayback-args

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

--- a/src/heretic/g_game.c
+++ b/src/heretic/g_game.c
@@ -1885,9 +1885,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++)
         playeringame[i] = (*demo_p++) != 0;
--- a/src/hexen/g_game.c
+++ b/src/hexen/g_game.c
@@ -2049,9 +2049,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++)
     {