1
0
Fork 0
forked from fte/fteqw

Misc fixes.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3930 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2011-12-06 00:39:39 +00:00
parent 345d9a6e50
commit 2d23892be0
3 changed files with 11 additions and 7 deletions

View file

@ -991,8 +991,8 @@ int CL_LoadModels(int stage, qboolean dontactuallyload)
s = Info_ValueForKey(cl.serverinfo, "*csprogs"); s = Info_ValueForKey(cl.serverinfo, "*csprogs");
if (anycsqc || *s || cls.demoplayback) //only allow csqc if the server says so, and the 'checksum' matches. 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); unsigned int chksum = strtoul(s, NULL, 0);
if (!CSQC_Init(chksum)) if (!CSQC_Init(anycsqc, chksum))
{ {
Sbar_Start(); //try and start this before we're actually on the server, 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. //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 #ifdef PEXT_CSQC
CSQC_Shutdown(); CSQC_Shutdown();
if (cls.demoplayback) if (cls.demoplayback)
CSQC_Init(0); CSQC_Init(true, 0);
#endif #endif
} }
void CLNQ_SignonReply (void) void CLNQ_SignonReply (void)
@ -2745,7 +2745,7 @@ Con_DPrintf ("CL_SignonReply: %i\n", cls.signon);
char *s; char *s;
s = Info_ValueForKey(cl.serverinfo, "*csprogs"); s = Info_ValueForKey(cl.serverinfo, "*csprogs");
if (*s) if (*s)
CSQC_Init(atoi(s)); CSQC_Init(false, atoi(s));
else else
CSQC_Shutdown(); CSQC_Shutdown();
} }

View file

@ -59,6 +59,7 @@ typedef struct csqctreadstate_s {
struct csqctreadstate_s *next; struct csqctreadstate_s *next;
} csqctreadstate_t; } csqctreadstate_t;
static qboolean csprogs_promiscuous;
static unsigned int csprogs_checksum, csaddon_checksum; static unsigned int csprogs_checksum, csaddon_checksum;
static csqctreadstate_t *csqcthreads; static csqctreadstate_t *csqcthreads;
qboolean csqc_resortfrags; qboolean csqc_resortfrags;
@ -4728,7 +4729,7 @@ qbyte *CSQC_PRLoadFile (const char *path, void *buffer, int bufsize)
file = COM_LoadStackFile(path, buffer, 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 (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) if (cls.protocol == CP_NETQUAKE)
{ {
@ -4783,7 +4784,7 @@ int CSQC_PRFileSize (const char *path)
file = COM_LoadTempFile(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 (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) if (cls.protocol == CP_NETQUAKE)
{ {
@ -4814,12 +4815,13 @@ qboolean CSQC_Inited(void)
} }
double csqctime; double csqctime;
qboolean CSQC_Init (unsigned int checksum) qboolean CSQC_Init (qboolean anycsqc, unsigned int checksum)
{ {
int i; int i;
string_t *str; string_t *str;
csqcedict_t *worldent; csqcedict_t *worldent;
qboolean loaded; qboolean loaded;
csprogs_promiscuous = anycsqc;
csprogs_checksum = checksum; csprogs_checksum = checksum;
csqc_usinglistener = false; csqc_usinglistener = false;

View file

@ -366,12 +366,14 @@ void PR_SSQC_Relocated(progfuncs_t *pr, char *oldb, char *newb, int oldlen)
} }
PR_SV_FillWorldGlobals(&sv.world); PR_SV_FillWorldGlobals(&sv.world);
#ifdef VM_Q1
for (i = 0; i < sv.world.num_edicts; i++) for (i = 0; i < sv.world.num_edicts; i++)
{ {
ent = EDICT_NUM(pr, i); ent = EDICT_NUM(pr, i);
if ((char*)ent->xv >= oldb && (char*)ent->xv < oldb+oldlen) if ((char*)ent->xv >= oldb && (char*)ent->xv < oldb+oldlen)
ent->xv = (extentvars_t*)((char*)ent->xv - oldb + newb); ent->xv = (extentvars_t*)((char*)ent->xv - oldb + newb);
} }
#endif
for (i = 0; sv.strings.model_precache[i]; i++) for (i = 0; sv.strings.model_precache[i]; i++)
{ {