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");
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();
}

View File

@ -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;

View File

@ -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++)
{