From 2d23892be02f6e1b7a0d353a47bfef319f7924ea Mon Sep 17 00:00:00 2001 From: Spoike Date: Tue, 6 Dec 2011 00:39:39 +0000 Subject: [PATCH] Misc fixes. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3930 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_parse.c | 8 ++++---- engine/client/pr_csqc.c | 8 +++++--- engine/server/pr_cmds.c | 2 ++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index a086feeb5..922a2cd76 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -991,8 +991,8 @@ int CL_LoadModels(int stage, qboolean dontactuallyload) s = Info_ValueForKey(cl.serverinfo, "*csprogs"); if (anycsqc || *s || cls.demoplayback) //only allow csqc if the server says so, and the 'checksum' matches. { - unsigned int chksum = anycsqc?0:strtoul(s, NULL, 0); - if (!CSQC_Init(chksum)) + unsigned int chksum = strtoul(s, NULL, 0); + if (!CSQC_Init(anycsqc, chksum)) { Sbar_Start(); //try and start this before we're actually on the server, //this'll stop the mod from sending so much stuffed data at us, whilst we're frozen while trying to load. @@ -2707,7 +2707,7 @@ void CLNQ_ParseServerData(void) //Doesn't change gamedir - use with caution. #ifdef PEXT_CSQC CSQC_Shutdown(); if (cls.demoplayback) - CSQC_Init(0); + CSQC_Init(true, 0); #endif } void CLNQ_SignonReply (void) @@ -2745,7 +2745,7 @@ Con_DPrintf ("CL_SignonReply: %i\n", cls.signon); char *s; s = Info_ValueForKey(cl.serverinfo, "*csprogs"); if (*s) - CSQC_Init(atoi(s)); + CSQC_Init(false, atoi(s)); else CSQC_Shutdown(); } diff --git a/engine/client/pr_csqc.c b/engine/client/pr_csqc.c index 1df8ef5fa..da57bf8bb 100644 --- a/engine/client/pr_csqc.c +++ b/engine/client/pr_csqc.c @@ -59,6 +59,7 @@ typedef struct csqctreadstate_s { struct csqctreadstate_s *next; } csqctreadstate_t; +static qboolean csprogs_promiscuous; static unsigned int csprogs_checksum, csaddon_checksum; static csqctreadstate_t *csqcthreads; qboolean csqc_resortfrags; @@ -4728,7 +4729,7 @@ qbyte *CSQC_PRLoadFile (const char *path, void *buffer, int bufsize) file = COM_LoadStackFile(path, buffer, bufsize); if (file && !cls.demoplayback) //allow them to use csprogs.dat if playing a demo, and don't care about the checksum { - if (csprogs_checksum) + if (csprogs_checksum && !csprogs_promiscuous) { if (cls.protocol == CP_NETQUAKE) { @@ -4783,7 +4784,7 @@ int CSQC_PRFileSize (const char *path) file = COM_LoadTempFile(path); if (file && !cls.demoplayback) //allow them to use csprogs.dat if playing a demo, and don't care about the checksum { - if (csprogs_checksum) + if (csprogs_checksum && !csprogs_promiscuous) { if (cls.protocol == CP_NETQUAKE) { @@ -4814,12 +4815,13 @@ qboolean CSQC_Inited(void) } double csqctime; -qboolean CSQC_Init (unsigned int checksum) +qboolean CSQC_Init (qboolean anycsqc, unsigned int checksum) { int i; string_t *str; csqcedict_t *worldent; qboolean loaded; + csprogs_promiscuous = anycsqc; csprogs_checksum = checksum; csqc_usinglistener = false; diff --git a/engine/server/pr_cmds.c b/engine/server/pr_cmds.c index 1324039b1..31ba97284 100644 --- a/engine/server/pr_cmds.c +++ b/engine/server/pr_cmds.c @@ -366,12 +366,14 @@ void PR_SSQC_Relocated(progfuncs_t *pr, char *oldb, char *newb, int oldlen) } PR_SV_FillWorldGlobals(&sv.world); +#ifdef VM_Q1 for (i = 0; i < sv.world.num_edicts; i++) { ent = EDICT_NUM(pr, i); if ((char*)ent->xv >= oldb && (char*)ent->xv < oldb+oldlen) ent->xv = (extentvars_t*)((char*)ent->xv - oldb + newb); } +#endif for (i = 0; sv.strings.model_precache[i]; i++) {