Fixed mvd playback as correctly as I can think how.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1902 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2006-01-28 19:04:13 +00:00
parent 6f98f6f108
commit fdb5cf3aff
10 changed files with 35 additions and 11 deletions

View File

@ -584,6 +584,8 @@ void CL_Stop_f (void)
cls.demofile = NULL;
cls.demorecording = false;
Con_Printf ("Completed demo\n");
FS_FlushFSHash();
}

View File

@ -1526,7 +1526,7 @@ void CL_LinkPacketEntities (void)
CL_CalcClientTime();
servertime = cl.servertime;
pack = CL_ProcessPacketEntities(&servertime, !!cl_nolerp.value);
pack = CL_ProcessPacketEntities(&servertime, !!cl_nolerp.value && cls.demoplayback != DPB_MVD);
if (!pack)
return;

View File

@ -955,6 +955,8 @@ void CL_ClearState (void)
SZ_Clear (&cls.netchan.message);
r_worldentity.model = NULL;
// clear other arrays
memset (cl_efrags, 0, sizeof(cl_efrags));
memset (cl_dlights, 0, sizeof(cl_dlights));
@ -1104,6 +1106,7 @@ void CL_Disconnect (void)
COM_FlushTempoaryPacks();
r_worldentity.model = NULL;
cl.spectator = 0;
cl.sendprespawn = false;

View File

@ -698,6 +698,8 @@ int CL_LoadModels(int stage)
Host_EndGame("No worldmodel was loaded\n");
R_NewMap ();
pmove.physents[0].model = cl.worldmodel;
endstage();
}
@ -1713,7 +1715,7 @@ void CLNQ_ParseServerData(void) //Doesn't change gamedir - use with caution.
if (MSG_ReadByte() > MAX_CLIENTS)
{
Con_Printf ("Warning, this server supports more than 32 clients, additional clients will do bad things\n");
Con_Printf ("\nWarning, this server supports more than %i clients, additional clients will do bad things\n", MAX_CLIENTS);
}
cl.splitclients = 1;
@ -4551,7 +4553,14 @@ void CLNQ_ParseServerMessage (void)
case svc_setview:
if (!cl.viewentity[0])
{
cl.playernum[0] = (cl.viewentity[0] = MSG_ReadShort())-1;
if (cl.playernum[0] >= MAX_CLIENTS)
{
cl.playernum[0] = 32; //pretend it's an mvd (we have that spare slot)
Con_Printf("^1WARNING: Server put us in slot %i. We are not on the scoreboard.\n");
}
}
else
cl.viewentity[0]=MSG_ReadShort();
break;
@ -4611,25 +4620,27 @@ void CLNQ_ParseServerMessage (void)
Sbar_Changed ();
i = MSG_ReadByte ();
if (i >= MAX_CLIENTS)
Host_EndGame ("CL_ParseServerMessage: svc_updatename > MAX_CLIENTS");
strcpy(cl.players[i].name, MSG_ReadString());
MSG_ReadString();
else
strcpy(cl.players[i].name, MSG_ReadString());
break;
case svc_updatefrags:
Sbar_Changed ();
i = MSG_ReadByte ();
if (i >= MAX_CLIENTS)
Host_EndGame ("CL_ParseServerMessage: svc_updatefrags > MAX_CLIENTS");
cl.players[i].frags = MSG_ReadShort();
MSG_ReadShort();
else
cl.players[i].frags = MSG_ReadShort();
break;
case svc_updatecolors:
{
int a;
Sbar_Changed ();
i = MSG_ReadByte ();
if (i >= MAX_CLIENTS)
Host_EndGame ("CL_ParseServerMessage: svc_updatecolors > MAX_CLIENTS");
a = MSG_ReadByte ();
if (i >= MAX_CLIENTS)
break;
//FIXME:!!!!
cl.players[i].topcolor = a&0x0f;

View File

@ -1013,11 +1013,13 @@ static void PF_R_SetViewFlag(progfuncs_t *prinst, struct globalvars_s *pr_global
case VF_ORIGIN:
VectorCopy(p, r_refdef.vieworg);
cl.crouch[0] = 0;
break;
case VF_ORIGIN_Z:
cl.crouch[0] = 0;
case VF_ORIGIN_X:
case VF_ORIGIN_Y:
case VF_ORIGIN_Z:
r_refdef.vieworg[parametertype-VF_ORIGIN_X] = *p;
break;

View File

@ -1526,7 +1526,7 @@ void V_RenderView (void)
if (cls.state != ca_active)
return;
if (cl.worldmodel)
if (r_worldentity.model)
{
RSpeedMark();

View File

@ -97,6 +97,8 @@ qboolean Q1BSP_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f,
}
#if 1
if (node->children[0] == node->children[1])
Host_Error("node child[0] == node child[1]\n");
if (t1 >= 0 && t2 >= 0)
return Q1BSP_RecursiveHullCheck (hull, node->children[0], p1f, p2f, p1, p2, trace);
if (t1 < 0 && t2 < 0)

View File

@ -280,7 +280,7 @@ void GLSCR_UpdateScreen (void)
nohud = true;
else
#endif
if (cl.worldmodel && uimenu != 1)
if (r_worldentity.model && uimenu != 1)
{
V_RenderView ();
Q1BSP_TestClipDecal();

View File

@ -571,6 +571,9 @@ void SV_SpawnServer (char *server, char *startspot, qboolean noents, qboolean us
#ifndef SERVERONLY
D_FlushCaches();
cl.worldmodel = NULL;
r_worldentity.model = NULL;
if (0)
cls.state = ca_connected;
#endif
#ifdef Q3SERVER

View File

@ -47,6 +47,7 @@ void ClientReliableCheckBlock(client_t *cl, int maxsize)
Con_Printf ("WARNING: MAX_BACK_BUFFERS for %s\n", cl->name);
cl->backbuf.cursize = 0; // don't overflow without allowoverflow set
cl->netchan.message.overflowed = true; // this will drop the client
cl->drop = true;
return;
}
memset(&cl->backbuf, 0, sizeof(cl->backbuf));