fixed demo playback covering multiple maps (from Pa3PyX's hexen2 source)

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@604 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2012-01-09 08:10:35 +00:00
parent 296dc11b52
commit 1918db04bf
2 changed files with 18 additions and 1 deletions

View file

@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h"
int stufftext_frame;
static void CL_FinishTimeDemo (void);
/*
@ -88,6 +90,13 @@ static int CL_GetDemoMessage (void)
// decide if it is time to grab the next message
if (cls.signon == SIGNONS) // always grab until fully connected
{
// Always wait for full frame update on stuff messages.
// If the server stuffs a reconnect, we must wait for
// the client to re-initialize before accepting further
// messages. Otherwise demo playback may freeze. Pa3PyX
if (stufftext_frame == host_framecount)
return 0;
if (cls.timedemo)
{
if (host_framecount == cls.td_lastframe)
@ -329,6 +338,10 @@ void CL_PlayDemo_f (void)
}
if (neg)
cls.forcetrack = -cls.forcetrack;
// Get a new message on playback start.
// Moved from CL_TimeDemo_f to here, Pa3PyX.
cls.td_lastframe = -1;
}
/*
@ -377,6 +390,7 @@ void CL_TimeDemo_f (void)
cls.timedemo = true;
cls.td_startframe = host_framecount;
cls.td_lastframe = -1; // get a new message this frame
// cls.td_lastframe = -1; // get a new message this frame
// Moved to CL_PlayDemo_f(), Pa3PyX.
}

View file

@ -91,6 +91,7 @@ const char *svc_strings[] =
qboolean warn_about_nehahra_protocol; //johnfitz
extern vec3_t v_punchangles[2]; //johnfitz
extern int stufftext_frame;
//=============================================================================
@ -1003,6 +1004,8 @@ void CL_ParseServerMessage (void)
break;
case svc_stufftext:
stufftext_frame = host_framecount; // allow full frame update
// on stuff messages. Pa3PyX
Cbuf_AddText (MSG_ReadString ());
break;