summaryrefslogtreecommitdiff
path: root/src/heretic
diff options
context:
space:
mode:
authorSimon Howard2014-03-23 03:30:41 -0400
committerSimon Howard2014-03-23 03:30:41 -0400
commit7a7a66e0af1be72938616b04ebebe6bd9dbd706c (patch)
tree9b864eccebbeb1690a155c9b7994833630c54377 /src/heretic
parentb295df80fe09802a774f9ef05d126f5139a383fa (diff)
downloadchocolate-doom-7a7a66e0af1be72938616b04ebebe6bd9dbd706c.tar.gz
chocolate-doom-7a7a66e0af1be72938616b04ebebe6bd9dbd706c.tar.bz2
chocolate-doom-7a7a66e0af1be72938616b04ebebe6bd9dbd706c.zip
heretic/hexen: Fix -timedemo.
The -timedemo flag is broken in Vanilla Heretic/Hexen, as not all fields are read from the demo headers. Fix it, as there's no utility in having it nonfunctional and plenty of utility in having it functional. This fixes #300.
Diffstat (limited to 'src/heretic')
-rw-r--r--src/heretic/g_game.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/heretic/g_game.c b/src/heretic/g_game.c
index 2ad9f4b3..5139c950 100644
--- a/src/heretic/g_game.c
+++ b/src/heretic/g_game.c
@@ -1735,12 +1735,18 @@ void G_DoPlayDemo(void)
void G_TimeDemo(char *name)
{
skill_t skill;
- int episode, map;
+ int episode, map, i;
demobuffer = demo_p = W_CacheLumpName(name, PU_STATIC);
skill = *demo_p++;
episode = *demo_p++;
map = *demo_p++;
+
+ for (i = 0; i < MAXPLAYERS; i++)
+ {
+ playeringame[i] = *demo_p++;
+ }
+
G_InitNew(skill, episode, map);
usergame = false;
demoplayback = true;
@@ -1761,13 +1767,16 @@ void G_TimeDemo(char *name)
boolean G_CheckDemoStatus(void)
{
- int endtime;
+ int endtime, realtics;
if (timingdemo)
{
+ float fps;
endtime = I_GetTime();
- I_Error("timed %i gametics in %i realtics", gametic,
- endtime - starttime);
+ realtics = endtime - starttime;
+ fps = ((float) gametic * TICRATE) / realtics;
+ I_Error("timed %i gametics in %i realtics (%f fps)",
+ gametic, realtics, fps);
}
if (demoplayback)