diff --git a/engine/client/cl_demo.c b/engine/client/cl_demo.c index 4d5e9713c..a03279bab 100644 --- a/engine/client/cl_demo.c +++ b/engine/client/cl_demo.c @@ -584,6 +584,8 @@ void CL_Stop_f (void) cls.demofile = NULL; cls.demorecording = false; Con_Printf ("Completed demo\n"); + + FS_FlushFSHash(); } diff --git a/engine/client/cl_ents.c b/engine/client/cl_ents.c index 4f7b2914f..405d0ddd8 100644 --- a/engine/client/cl_ents.c +++ b/engine/client/cl_ents.c @@ -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; diff --git a/engine/client/cl_main.c b/engine/client/cl_main.c index 650ce7d37..c796d289b 100644 --- a/engine/client/cl_main.c +++ b/engine/client/cl_main.c @@ -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; diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index 7a1a405ad..ea6a739a3 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -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; diff --git a/engine/client/pr_csqc.c b/engine/client/pr_csqc.c index a5b939e94..60f278aea 100644 --- a/engine/client/pr_csqc.c +++ b/engine/client/pr_csqc.c @@ -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; diff --git a/engine/client/view.c b/engine/client/view.c index 742812cdc..3442b1f54 100644 --- a/engine/client/view.c +++ b/engine/client/view.c @@ -1526,7 +1526,7 @@ void V_RenderView (void) if (cls.state != ca_active) return; - if (cl.worldmodel) + if (r_worldentity.model) { RSpeedMark(); diff --git a/engine/common/q1bsp.c b/engine/common/q1bsp.c index 308024c39..0da9c7907 100644 --- a/engine/common/q1bsp.c +++ b/engine/common/q1bsp.c @@ -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) diff --git a/engine/gl/gl_screen.c b/engine/gl/gl_screen.c index 1e5f3a8c3..184325440 100644 --- a/engine/gl/gl_screen.c +++ b/engine/gl/gl_screen.c @@ -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(); diff --git a/engine/server/sv_init.c b/engine/server/sv_init.c index cb78d3515..dfe56939f 100644 --- a/engine/server/sv_init.c +++ b/engine/server/sv_init.c @@ -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 diff --git a/engine/server/sv_nchan.c b/engine/server/sv_nchan.c index 617532a56..178c3e3e3 100644 --- a/engine/server/sv_nchan.c +++ b/engine/server/sv_nchan.c @@ -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));