ref: 3524a67dd3c7d48a172c83d3ae170a7176fb3cfa
parent: e1ac9379f676b38d2c2c003efc41b81bcfcdb29c
parent: 22b0a5610f608ae3931f84b409434f5fe9264a0e
author: Simon Howard <fraggle@soulsphere.org>
date: Sun Jul 25 11:55:34 EDT 2021
Merge pull request #1382 from kraflab/fix-hexen-coop Fix hexen coop demo playback
--- a/src/hexen/g_game.c
+++ b/src/hexen/g_game.c
@@ -99,6 +99,7 @@
boolean shortticfix; // calculate lowres turning like doom
boolean demoplayback;
boolean demoextend;
+boolean netdemo;
byte *demobuffer, *demo_p, *demoend;
boolean singledemo; // quit after playing a demo from cmdline
@@ -1020,7 +1021,7 @@
if (demorecording)
G_WriteDemoTiccmd(cmd);
- if (netgame && !(gametic % ticdup))
+ if (netgame && !netdemo && !(gametic % ticdup))
{
if (gametic > BACKUPTICS
&& consistancy[i][buf] != cmd->consistancy)
@@ -1794,6 +1795,7 @@
// loading a saved one from the menu, and only during playback.
demorecording = false;
demoplayback = false;
+ netdemo = false;
usergame = true; // will be set false if a demo
}
paused = false;
@@ -2093,6 +2095,12 @@
PlayerClass[i] = *demo_p++;
}
+ if (playeringame[1] || M_ParmExists("-solo-net")
+ || M_ParmExists("-netdemo"))
+ {
+ netgame = true;
+ }
+
// Initialize world info, etc.
G_StartNewInit();
@@ -2101,6 +2109,11 @@
precache = true;
usergame = false;
demoplayback = true;
+
+ if (netgame)
+ {
+ netdemo = true;
+ }
}
@@ -2135,6 +2148,12 @@
PlayerClass[i] = *demo_p++;
}
+ if (playeringame[1] || M_ParmExists("-solo-net")
+ || M_ParmExists("-netdemo"))
+ {
+ netgame = true;
+ }
+
G_InitNew(skill, episode, map);
starttime = I_GetTime();
@@ -2142,6 +2161,11 @@
demoplayback = true;
timingdemo = true;
singletics = true;
+
+ if (netgame)
+ {
+ netdemo = true;
+ }
}
@@ -2176,6 +2200,8 @@
W_ReleaseLumpName(defdemoname);
demoplayback = false;
+ netdemo = false;
+ netgame = false;
H2_AdvanceDemo();
return true;
}