Skip to content

Commit

Permalink
Merge pull request #1382 from kraflab/fix-hexen-coop
Browse files Browse the repository at this point in the history
Fix hexen coop demo playback
  • Loading branch information
fragglet committed Jul 25, 2021
2 parents e1ac937 + 22b0a56 commit 3524a67
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion src/hexen/g_game.c
Expand Up @@ -99,6 +99,7 @@ boolean lowres_turn;
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

Expand Down Expand Up @@ -1020,7 +1021,7 @@ void G_Ticker(void)
if (demorecording)
G_WriteDemoTiccmd(cmd);

if (netgame && !(gametic % ticdup))
if (netgame && !netdemo && !(gametic % ticdup))
{
if (gametic > BACKUPTICS
&& consistancy[i][buf] != cmd->consistancy)
Expand Down Expand Up @@ -1794,6 +1795,7 @@ void G_InitNew(skill_t skill, int episode, int map)
// 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;
Expand Down Expand Up @@ -2093,6 +2095,12 @@ void G_DoPlayDemo(void)
PlayerClass[i] = *demo_p++;
}

if (playeringame[1] || M_ParmExists("-solo-net")
|| M_ParmExists("-netdemo"))
{
netgame = true;
}

// Initialize world info, etc.
G_StartNewInit();

Expand All @@ -2101,6 +2109,11 @@ void G_DoPlayDemo(void)
precache = true;
usergame = false;
demoplayback = true;

if (netgame)
{
netdemo = true;
}
}


Expand Down Expand Up @@ -2135,13 +2148,24 @@ void G_TimeDemo(char *name)
PlayerClass[i] = *demo_p++;
}

if (playeringame[1] || M_ParmExists("-solo-net")
|| M_ParmExists("-netdemo"))
{
netgame = true;
}

G_InitNew(skill, episode, map);
starttime = I_GetTime();

usergame = false;
demoplayback = true;
timingdemo = true;
singletics = true;

if (netgame)
{
netdemo = true;
}
}


Expand Down Expand Up @@ -2176,6 +2200,8 @@ boolean G_CheckDemoStatus(void)

W_ReleaseLumpName(defdemoname);
demoplayback = false;
netdemo = false;
netgame = false;
H2_AdvanceDemo();
return true;
}
Expand Down

0 comments on commit 3524a67

Please sign in to comment.