From 9bd02ae55b492dad808d801ddd8f9257605bc318 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Sun, 24 Aug 2014 18:37:28 +0000 Subject: [PATCH] cl_parse.c: hack so demos playback at the correct speed even if they contain a lot of svc_stufftext messages (e.g. one every frame). for a test case, play a demo from: http://www.quaketastic.com/upload/files/demos/otp_honey100.zip for the honey map pack: http://www.quaketastic.com/upload/files/single_player/maps/honey.zip on a slow pc that gets signifigantly less than 72fps, or with host_maxfps lowered (e.g. set to 33). with QS 0.85.9, the demo will play in slow-motion; with QS 0.85.6 (without the cross-map demo support) it plays normally. admittedly this is a fringe scenario, but it's imo a legitimate bug in the Pa3PyX cross-map demo playback code. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@974 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/cl_parse.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Quake/cl_parse.c b/Quake/cl_parse.c index 338bdff2..367fefc7 100644 --- a/Quake/cl_parse.c +++ b/Quake/cl_parse.c @@ -999,9 +999,18 @@ void CL_ParseServerMessage (void) break; case svc_stufftext: - cls.stufftext_frame = host_framecount; // allow full frame update - // in demo playback -- Pa3PyX - Cbuf_AddText (MSG_ReadString ()); + str = MSG_ReadString (); + // ericw -- hack - only wait for the full frame update if the stufftext + // contains "reconnect". some mods, e.g. honey, send stufftext every frame; + // if we were to set cls.stufftext_frame every frame, that would break + // the playback rate control (causing demos to play back in slow-motion + // if the client can't keep up) + if (strstr (str, "reconnect") != NULL) + { + cls.stufftext_frame = host_framecount; // allow full frame update + // in demo playback -- Pa3PyX + } + Cbuf_AddText (str); break; case svc_damage: