"NEXUIZ_PLAYERSKIN "
;
-qboolean checkextension(char *name)
+qboolean checkextension(const char *name)
{
int len;
char *e, *start;
if (e->e->free)
PF_WARNING("setmodel: can not modify free entity\n");
i = SV_ModelIndex(G_STRING(OFS_PARM1), 1);
- e->v->model = PR_SetString(sv.model_precache[i]);
+ e->v->model = PR_SetEngineString(sv.model_precache[i]);
e->v->modelindex = i;
mod = sv.models[i];
*/
void PF_ambientsound (void)
{
- char *samp;
+ const char *samp;
float *pos;
float vol, attenuation;
int soundnum, large;
*/
void PF_sound (void)
{
- char *sample;
+ const char *sample;
int channel;
edict_t *entity;
int volume;
void PF_stuffcmd (void)
{
int entnum;
- char *str;
+ const char *str;
client_t *old;
entnum = G_EDICTNUM(OFS_PARM0);
sprintf(s, "%i", (int)v);
else
sprintf(s, "%f", v);
- G_INT(OFS_RETURN) = PR_SetString(s);
+ G_INT(OFS_RETURN) = PR_SetEngineString(s);
}
void PF_fabs (void)
char *s;
s = PR_GetTempString();
sprintf (s, "'%5.1f %5.1f %5.1f'", G_VECTOR(OFS_PARM0)[0], G_VECTOR(OFS_PARM0)[1], G_VECTOR(OFS_PARM0)[2]);
- G_INT(OFS_RETURN) = PR_SetString(s);
+ G_INT(OFS_RETURN) = PR_SetEngineString(s);
}
void PF_etos (void)
char *s;
s = PR_GetTempString();
sprintf (s, "entity %i", G_EDICTNUM(OFS_PARM0));
- G_INT(OFS_RETURN) = PR_SetString(s);
+ G_INT(OFS_RETURN) = PR_SetEngineString(s);
}
void PF_Spawn (void)
{
int e;
int f;
- char *s, *t;
+ const char *s, *t;
edict_t *ed;
e = G_EDICTNUM(OFS_PARM0);
{
int i;
int f;
- char *s, *t;
+ const char *s, *t;
edict_t *ent, *chain;
chain = (edict_t *)sv.edicts;
RETURN_EDICT(chain);
}
-void PR_CheckEmptyString (char *s)
-{
- if (s[0] <= ' ')
- PF_ERROR("Bad string");
-}
-
void PF_precache_file (void)
{ // precache_file is only used to copy files with qcc, it does nothing
G_INT(OFS_RETURN) = G_INT(OFS_PARM0);
void PF_lightstyle (void)
{
int style;
- char *val;
+ const char *val;
client_t *client;
int j;
val = G_STRING(OFS_PARM1);
// change the string in sv
- sv.lightstyles[style] = val;
+ strlcpy(sv.lightstyles[style], val, sizeof(sv.lightstyles[style]));
// send message to all clients on this server
if (sv.state != ss_active)
*/
void PF_changelevel (void)
{
- char *s;
+ const char *s;
// make sure we don't issue two changelevels
if (svs.changelevel_issued)
void PF_registercvar (void)
{
- char *name, *value;
+ const char *name, *value;
name = G_STRING(OFS_PARM0);
value = G_STRING(OFS_PARM1);
G_FLOAT(OFS_RETURN) = 0;
void PF_effect (void)
{
int i;
- char *s;
+ const char *s;
s = G_STRING(OFS_PARM1);
if (!s || !s[0])
PF_WARNING("effect: no model specified\n");
model = sv.models[modelindex];
if (surfacenum < 0 || surfacenum >= model->nummodelsurfaces)
return NULL;
- return model->brush.data_surfaces + surfacenum + model->firstmodelsurface;
+ return model->data_surfaces + surfacenum + model->firstmodelsurface;
}
G_INT(OFS_RETURN) = 0;
if (!(surface = getsurface(G_EDICT(OFS_PARM0), G_FLOAT(OFS_PARM1))))
return;
- G_INT(OFS_RETURN) = PR_SetString(surface->texture->name);
+ G_INT(OFS_RETURN) = PR_SetEngineString(surface->texture->name);
}
//PF_getsurfacenearpoint, // #438 float(entity e, vector p) getsurfacenearpoint = #438;
void PF_getsurfacenearpoint(void)
if (modelindex < 1 || modelindex >= MAX_MODELS)
return;
model = sv.models[modelindex];
- if (!model->brush.num_surfaces)
+ if (!model->num_surfaces)
return;
// FIXME: implement rotation/scaling
bestdist = 1000000000;
for (surfacenum = 0;surfacenum < model->nummodelsurfaces;surfacenum++)
{
- surface = model->brush.data_surfaces + surfacenum + model->firstmodelsurface;
+ surface = model->data_surfaces + surfacenum + model->firstmodelsurface;
// first see if the nearest point on the surface's box is closer than the previous match
clipped[0] = bound(surface->mins[0], p[0], surface->maxs[0]) - p[0];
clipped[1] = bound(surface->mins[1], p[1], surface->maxs[1]) - p[1];
void PF_fopen(void)
{
int filenum, mode;
- char *modestring, *filename;
+ const char *modestring, *filename;
for (filenum = 0;filenum < MAX_PRFILES;filenum++)
if (pr_files[filenum] == NULL)
break;
if (developer.integer)
Con_Printf("fgets: %s\n", string);
if (c >= 0 || end)
- G_INT(OFS_RETURN) = PR_SetString(string);
+ G_INT(OFS_RETURN) = PR_SetEngineString(string);
else
G_INT(OFS_RETURN) = 0;
}
//float(string s) strlen = #114; // returns how many characters are in a string
void PF_strlen(void)
{
- char *s;
+ const char *s;
s = G_STRING(OFS_PARM0);
if (s)
G_FLOAT(OFS_RETURN) = strlen(s);
{
char *s = PR_GetTempString();
PF_VarString(0, s, STRINGTEMP_LENGTH);
- G_INT(OFS_RETURN) = PR_SetString(s);
+ G_INT(OFS_RETURN) = PR_SetEngineString(s);
}
//string(string s, float start, float length) substring = #116; // returns a section of a string as a tempstring
void PF_substring(void)
{
int i, start, length;
- char *s, *string = PR_GetTempString();
+ const char *s;
+ char *string = PR_GetTempString();
s = G_STRING(OFS_PARM0);
start = G_FLOAT(OFS_PARM1);
length = G_FLOAT(OFS_PARM2);
for (i = 0;i < STRINGTEMP_LENGTH - 1 && *s && i < length;i++, s++)
string[i] = *s;
string[i] = 0;
- G_INT(OFS_RETURN) = PR_SetString(string);
+ G_INT(OFS_RETURN) = PR_SetEngineString(string);
}
//vector(string s) stov = #117; // returns vector value from a string
//string(string s) strzone = #118; // makes a copy of a string into the string zone and returns it, this is often used to keep around a tempstring for longer periods of time (tempstrings are replaced often)
void PF_strzone(void)
{
- char *in, *out;
+ const char *in;
+ char *out;
in = G_STRING(OFS_PARM0);
- out = PR_Alloc(strlen(in) + 1);
+ out = PR_AllocString(strlen(in) + 1);
strcpy(out, in);
- G_INT(OFS_RETURN) = PR_SetString(out);
+ G_INT(OFS_RETURN) = PR_SetQCString(out);
}
//void(string s) strunzone = #119; // removes a copy of a string from the string zone (you can not use that string again or it may crash!!!)
void PF_strunzone(void)
{
- PR_Free(G_STRING(OFS_PARM0));
+ PR_FreeString((char *)G_STRING(OFS_PARM0));
}
//void(entity e, string s) clientcommand = #440; // executes a command string as if it came from the specified client
{
int token_num = G_FLOAT(OFS_PARM0);
if (token_num >= 0 && token_num < num_tokens)
- G_INT(OFS_RETURN) = PR_SetString(tokens[token_num]);
+ G_INT(OFS_RETURN) = PR_SetEngineString(tokens[token_num]);
else
- G_INT(OFS_RETURN) = PR_SetString("");
+ G_INT(OFS_RETURN) = PR_SetEngineString(NULL);
}
//void(entity e, entity tagentity, string tagname) setattachment = #443; // attachs e to a tag on tagentity (note: use "" to attach to entity origin/angles instead of a tag)
{
edict_t *e = G_EDICT(OFS_PARM0);
edict_t *tagentity = G_EDICT(OFS_PARM1);
- char *tagname = G_STRING(OFS_PARM2);
+ const char *tagname = G_STRING(OFS_PARM2);
eval_t *v;
int modelindex;
model_t *model;
/////////////////////////////////////////
// DP_MD3_TAGINFO extension coded by VorteX
-int SV_GetTagIndex (edict_t *e, char *tagname)
+int SV_GetTagIndex (edict_t *e, const char *tagname)
{
int i;
model_t *model;
void PF_gettagindex (void)
{
edict_t *ent = G_EDICT(OFS_PARM0);
- char *tag_name = G_STRING(OFS_PARM1);
+ const char *tag_name = G_STRING(OFS_PARM1);
int modelindex, tag_index;
if (ent == sv.edicts)
void PF_search_begin(void)
{
int handle;
- char *pattern;
+ const char *pattern;
int caseinsens, quiet;
pattern = G_STRING(OFS_PARM0);
-
- PR_CheckEmptyString(pattern);
+ if (!pattern || pattern[0] <= ' ')
+ PF_ERROR("PF_search_begin: Bad string");
caseinsens = G_FLOAT(OFS_PARM1);
quiet = G_FLOAT(OFS_PARM2);
tmp = PR_GetTempString();
strcpy(tmp, pr_fssearchlist[handle]->filenames[filenum]);
- G_INT(OFS_RETURN) = PR_SetString(tmp);
+ G_INT(OFS_RETURN) = PR_SetEngineString(tmp);
}
void PF_cvar_string (void)
{
- char *str;
+ const char *str;
cvar_t *var;
char *tmp;
strcpy(tmp, var->string);
}
else
- tmp = "";
- G_INT(OFS_RETURN) = PR_SetString(tmp);
+ tmp = NULL;
+ G_INT(OFS_RETURN) = PR_SetEngineString(tmp);
}
//void(entity clent) dropclient (DP_SV_DROPCLIENT)