=====================
*/
+void CL_VM_ShutDown (void);
void CL_ClearState(void)
{
int i;
entity_t *ent;
+ CL_VM_ShutDown();
+
// wipe the entire cl structure
Mem_EmptyPool(cls.levelmempool);
memset (&cl, 0, sizeof(cl));
if (!allowmodel && (!strcasecmp(key, "pmodel") || !strcasecmp(key, "emodel")))
fail = true;
for (i = 0;key[i];i++)
- if (key[i] <= ' ' || key[i] == '\"')
+ if (ISWHITESPACE(key[i]) || key[i] == '\"')
fail = true;
for (i = 0;value[i];i++)
if (value[i] == '\r' || value[i] == '\n' || value[i] == '\"')
}
}
-void CL_VM_ShutDown (void);
/*
=====================
CL_Disconnect
Con_DPrintf("CL_Disconnect\n");
+ Cvar_SetValueQuick(&csqc_progcrc, -1);
+ Cvar_SetValueQuick(&csqc_progsize, -1);
CL_VM_ShutDown();
// stop sounds (especially looping!)
S_StopAllSounds ();
e->render.flags = e->state_current.flags;
e->render.effects = e->state_current.effects;
VectorScale(e->state_current.colormod, (1.0f / 32.0f), e->render.colormod);
- e->render.entitynumber = e - cl.entities;
+ if(e >= cl.entities && e < cl.entities + cl.num_entities)
+ e->render.entitynumber = e - cl.entities;
+ else
+ e->render.entitynumber = 0;
if (e->state_current.flags & RENDER_COLORMAPPED)
CL_SetEntityColormapColors(&e->render, e->state_current.colormap);
else if (e->state_current.colormap > 0 && e->state_current.colormap <= cl.maxclients && cl.scores != NULL)
e->render.flags |= RENDER_SHADOW;
if (e->render.flags & RENDER_VIEWMODEL)
e->render.flags |= RENDER_NOSELFSHADOW;
+ if (e->render.effects & EF_NOSELFSHADOW)
+ e->render.flags |= RENDER_NOSELFSHADOW;
// make the other useful stuff
CL_UpdateRenderEntity(&e->render);
FS_StripExtension(cl.worldmodel->name, locfilename, sizeof(locfilename));
strlcat(locfilename, ".loc", sizeof(locfilename));
- outfile = FS_Open(locfilename, "w", false, false);
+ outfile = FS_OpenRealFile(locfilename, "w", false);
if (!outfile)
return;
// if any boxes are used then this is a proquake-format loc file, which
if (text < textend)
text++;
// trim trailing whitespace
- while (lineend > linestart && lineend[-1] <= ' ')
+ while (lineend > linestart && ISWHITESPACE(lineend[-1]))
lineend--;
// trim leading whitespace
- while (linestart < lineend && *linestart <= ' ')
+ while (linestart < lineend && ISWHITESPACE(*linestart))
linestart++;
// check if this is a comment
if (linestart + 2 <= lineend && !strncmp(linestart, "//", 2))
else
maxs[i - 3] = atof(linetext);
// now advance past the number
- while (linetext < lineend && *linetext > ' ' && *linetext != ',')
+ while (linetext < lineend && !ISWHITESPACE(*linetext) && *linetext != ',')
linetext++;
// advance through whitespace
if (linetext < lineend)
limit = 6;
// note: comma can be followed by whitespace
}
- if (*linetext <= ' ')
+ if (ISWHITESPACE(*linetext))
{
// skip whitespace
- while (linetext < lineend && *linetext <= ' ')
+ while (linetext < lineend && ISWHITESPACE(*linetext))
linetext++;
}
}