"DP_EF_FLAME "
"DP_EF_FULLBRIGHT "
"DP_EF_NODRAW "
+"DP_EF_NOSHADOW "
"DP_EF_RED "
"DP_EF_STARDUST "
"DP_ENT_ALPHA "
"DP_SV_EXTERIORMODELTOCLIENT "
"DP_SV_NODRAWTOCLIENT "
"DP_SV_PLAYERPHYSICS "
+"DP_SV_ROTATINGBMODEL "
"DP_SV_SETCOLOR "
"DP_SV_SLOWMO "
"DP_TE_BLOOD "
"KRIMZON_SV_PARSECLIENTCOMMAND "
"NEH_CMD_PLAY2 "
"NEH_RESTOREGAME "
+"TENEBRAE_GFX_DLIGHTS "
"TW_SV_STEPCONTROL "
;
char string[STRINGTEMP_LENGTH];
PF_VarString(0, string, sizeof(string));
- Con_Printf ("======SERVER ERROR in %s:\n%s\n", PR_GetString(pr_xfunction->s_name), string);
+ Con_Printf("======SERVER ERROR in %s:\n%s\n", PR_GetString(pr_xfunction->s_name), string);
ed = PROG_TO_EDICT(pr_global_struct->self);
- ED_Print (ed);
+ ED_Print(ed);
PF_ERROR("Program error");
}
char string[STRINGTEMP_LENGTH];
PF_VarString(0, string, sizeof(string));
- Con_Printf ("======OBJECT ERROR in %s:\n%s\n", PR_GetString(pr_xfunction->s_name), string);
+ Con_Printf("======OBJECT ERROR in %s:\n%s\n", PR_GetString(pr_xfunction->s_name), string);
ed = PROG_TO_EDICT(pr_global_struct->self);
- ED_Print (ed);
+ ED_Print(ed);
ED_Free (ed);
}
{
char string[STRINGTEMP_LENGTH];
PF_VarString(0, string, sizeof(string));
- SV_BroadcastPrintf("%s", string);
+ SV_BroadcastPrint(string);
}
/*
if (entnum < 1 || entnum > svs.maxclients || !svs.clients[entnum-1].active)
{
- Con_Printf ("tried to sprint to a non-client\n");
+ Con_Print("tried to sprint to a non-client\n");
return;
}
if (entnum < 1 || entnum > svs.maxclients || !svs.clients[entnum-1].active)
{
- Con_Printf ("tried to sprint to a non-client\n");
+ Con_Print("tried to sprint to a non-client\n");
return;
}
if (!*check)
{
- Con_Printf ("no precache: %s\n", samp);
+ Con_Printf("no precache: %s\n", samp);
return;
}
{
float *v1, *v2;
trace_t trace;
- int nomonsters;
+ int move;
edict_t *ent;
pr_xfunction->builtinsprofile += 30;
v1 = G_VECTOR(OFS_PARM0);
v2 = G_VECTOR(OFS_PARM1);
- nomonsters = G_FLOAT(OFS_PARM2);
+ move = G_FLOAT(OFS_PARM2);
ent = G_EDICT(OFS_PARM3);
- trace = SV_Move (v1, vec3_origin, vec3_origin, v2, nomonsters, ent);
+ trace = SV_Move (v1, vec3_origin, vec3_origin, v2, move, ent);
pr_global_struct->trace_allsolid = trace.allsolid;
pr_global_struct->trace_startsolid = trace.startsolid;
{
float *v1, *v2, *m1, *m2;
trace_t trace;
- int nomonsters;
+ int move;
edict_t *ent;
pr_xfunction->builtinsprofile += 30;
m1 = G_VECTOR(OFS_PARM1);
m2 = G_VECTOR(OFS_PARM2);
v2 = G_VECTOR(OFS_PARM3);
- nomonsters = G_FLOAT(OFS_PARM4);
+ move = G_FLOAT(OFS_PARM4);
ent = G_EDICT(OFS_PARM5);
- trace = SV_Move (v1, m1, m2, v2, nomonsters ? MOVE_NOMONSTERS : MOVE_NORMAL, ent);
+ trace = SV_Move (v1, m1, m2, v2, move, ent);
pr_global_struct->trace_allsolid = trace.allsolid;
pr_global_struct->trace_startsolid = trace.startsolid;
entnum = G_EDICTNUM(OFS_PARM0);
if (entnum < 1 || entnum > svs.maxclients || !svs.clients[entnum-1].active)
{
- Con_Printf("Can't stuffcmd to a non-client");
+ Con_Print("Can't stuffcmd to a non-client\n");
return;
}
str = G_STRING(OFS_PARM1);
if (developer.integer)
{
PF_VarString(0, string, sizeof(string));
- Con_Printf("%s",string);
+ Con_Print(string);
}
}
i = NUM_FOR_EDICT(ent);
if (i < 1 || i > svs.maxclients || !svs.clients[i-1].active)
{
- Con_Printf("tried to setspawnparms on a non-client\n");
+ Con_Print("tried to setspawnparms on a non-client\n");
return;
}
// check for overlap with a command
if (Cmd_Exists (name))
{
- Con_Printf ("PF_registercvar: %s is a command\n", name);
+ Con_Printf("PF_registercvar: %s is a command\n", name);
return;
}
if (entnum < 1 || entnum > svs.maxclients || !svs.clients[entnum-1].active)
{
- Con_Printf ("tried to setcolor a non-client\n");
+ Con_Print("tried to setcolor a non-client\n");
return;
}
if (modelindex < 1 || modelindex >= MAX_MODELS)
return NULL;
model = sv.models[modelindex];
- if (surfnum < 0 || surfnum >= model->brushq1.nummodelsurfaces)
+ if (surfnum < 0 || surfnum >= model->nummodelsurfaces)
return NULL;
- return model->brushq1.surfaces + surfnum + model->brushq1.firstmodelsurface;
+ return model->brushq1.surfaces + surfnum + model->firstmodelsurface;
}
VectorSubtract(point, ed->v->origin, p);
best = -1;
bestdist = 1000000000;
- for (surfnum = 0;surfnum < model->brushq1.nummodelsurfaces;surfnum++)
+ for (surfnum = 0;surfnum < model->nummodelsurfaces;surfnum++)
{
- surf = model->brushq1.surfaces + surfnum + model->brushq1.firstmodelsurface;
+ surf = model->brushq1.surfaces + surfnum + model->firstmodelsurface;
dist = PlaneDiff(p, surf->plane);
dist = dist * dist;
if (dist < bestdist)
//float(string filename, float mode) fopen = #110; // opens a file inside quake/gamedir/data/ (mode is FILE_READ, FILE_APPEND, or FILE_WRITE), returns fhandle >= 0 if successful, or fhandle < 0 if unable to open file for any reason
void PF_fopen(void)
{
- int filenum, mode;
+ int filenum, mode, i;
char *modestring, *filename;
for (filenum = 0;filenum < MAX_PRFILES;filenum++)
if (pr_files[filenum] == NULL)
return;
}
filename = G_STRING(OFS_PARM0);
- // .. is parent directory on many platforms
- // / is parent directory on Amiga
+ // control characters do not cause issues with any platforms I know of, but they are usually annoying to deal with
+ // ../ is parent directory on many platforms
+ // // is parent directory on Amiga
+ // / at the beginning of a path is root on unix, and parent directory on Amiga
// : is root of drive on Amiga (also used as a directory separator on Mac, but / works there too, so that's a bad idea)
// \ is a windows-ism (so it's naughty to use it, / works on all platforms)
- if ((filename[0] == '.' && filename[1] == '.') || filename[0] == '/' || strrchr(filename, ':') || strrchr(filename, '\\'))
+ for (i = 0;filename[i];i++)
{
- Con_Printf("PF_fopen: dangerous or non-portable filename \"%s\" not allowed. (contains : or \\ or begins with .. or /)\n", filename);
- G_FLOAT(OFS_RETURN) = -4;
- return;
+ if (filename[i] < ' ' || (filename[i] == '/' && filename[i+1] == '/') || (filename[i] == '.' && filename[i+1] == '.') || filename[i] == ':' || filename[i] == '\\' || filename[0] == '/')
+ {
+ Con_Printf("PF_fopen: dangerous/confusing/annoying/non-portable filename \"%s\" not allowed. (contains control characters or // or .. or : or \\ or begins with /)\n", filename);
+ G_FLOAT(OFS_RETURN) = -4;
+ return;
+ }
}
pr_files[filenum] = FS_Open(va("data/%s", filename), modestring, false);
+
+ if (pr_files[filenum] == NULL && modestring == "rb")
+ pr_files[filenum] = FS_Open(filename, modestring, false);
+
if (pr_files[filenum] == NULL)
G_FLOAT(OFS_RETURN) = -1;
else
i = (NUM_FOR_EDICT(G_EDICT(OFS_PARM0)) - 1);
if (i < 0 || i >= svs.maxclients || !svs.clients[i].active)
{
- Con_Printf("PF_clientcommand: entity is not a client");
+ Con_Print("PF_clientcommand: entity is not a client\n");
return;
}