shithub: choc

Download patch

ref: 621a8d8362856fbd4627f81f14a00e19aee0744f
parent: 406a15b8408a102a29fe5c3e67323aa53d6b56c1
author: Thomas A. Birkel <[email protected]>
date: Thu Nov 10 18:44:06 EST 2016

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

-nomonsters and -respawn need to be read for vanilla demo playback: this
fix allows either command line or special bits to enable them.

Fix for #803

--- 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++)
     {