//4 feature darkplaces csqc: add builtin to clientside qc for reading triangles of model meshes (useful to orient a ui along a triangle of a model mesh)
//4 feature darkplaces csqc: add builtins to clientside qc for gl calls
-#ifndef PF_WARNING
-#define PF_WARNING(s) do{Con_Printf(s);PRVM_PrintState();return;}while(0)
-#endif
-
//[515]: really need new list ?
char *vm_cl_extensions =
"DP_CON_SET "
e = PRVM_G_EDICT(OFS_PARM0);
if (e == prog->edicts)
- PF_WARNING("setorigin: can not modify world entity\n");
+ {
+ VM_Warning("setorigin: can not modify world entity\n");
+ return;
+ }
if (e->priv.required->free)
- PF_WARNING("setorigin: can not modify free entity\n");
+ {
+ VM_Warning("setorigin: can not modify free entity\n");
+ return;
+ }
org = PRVM_G_VECTOR(OFS_PARM1);
VectorCopy (org, e->fields.client->origin);
}
e = PRVM_G_EDICT(OFS_PARM0);
if (e == prog->edicts)
- PF_WARNING("setsize: can not modify world entity\n");
+ {
+ VM_Warning("setsize: can not modify world entity\n");
+ return;
+ }
if (e->priv.server->free)
- PF_WARNING("setsize: can not modify free entity\n");
+ {
+ VM_Warning("setsize: can not modify free entity\n");
+ return;
+ }
min = PRVM_G_VECTOR(OFS_PARM1);
max = PRVM_G_VECTOR(OFS_PARM2);
attenuation = PRVM_G_FLOAT(OFS_PARM4);
if (volume < 0 || volume > 255)
- PF_WARNING("VM_CL_sound: volume must be in range 0-1\n");
+ {
+ VM_Warning("VM_CL_sound: volume must be in range 0-1\n");
+ return;
+ }
if (attenuation < 0 || attenuation > 4)
- PF_WARNING("VM_CL_sound: attenuation must be in range 0-4\n");
+ {
+ VM_Warning("VM_CL_sound: attenuation must be in range 0-4\n");
+ return;
+ }
if (channel < 0 || channel > 7)
- PF_WARNING("VM_CL_sound: channel must be in range 0-7\n");
+ {
+ VM_Warning("VM_CL_sound: channel must be in range 0-7\n");
+ return;
+ }
S_StartSound(32768 + PRVM_NUM_FOR_EDICT(entity), channel, S_FindName(sample), entity->fields.client->origin, volume, attenuation);
}
if(!cl.csqc_model_precache[i])
break;
if(i == MAX_MODELS)
- PF_WARNING("VM_CL_precache_model: no free models\n");
+ {
+ VM_Warning("VM_CL_precache_model: no free models\n");
+ return;
+ }
cl.csqc_model_precache[i] = (model_t*)m;
PRVM_G_FLOAT(OFS_RETURN) = -(i+1);
return;
}
- Con_Printf("VM_CL_precache_model: model \"%s\" not found\n", name);
+ VM_Warning("VM_CL_precache_model: model \"%s\" not found\n", name);
}
int CSQC_EntitiesInBox (vec3_t mins, vec3_t maxs, int maxlist, prvm_edict_t **list)
ent = PRVM_PROG_TO_EDICT(prog->globals.client->self);
if (ent == prog->edicts)
- PF_WARNING("droptofloor: can not modify world entity\n");
+ {
+ VM_Warning("droptofloor: can not modify world entity\n");
+ return;
+ }
if (ent->priv.server->free)
- PF_WARNING("droptofloor: can not modify free entity\n");
+ {
+ VM_Warning("droptofloor: can not modify free entity\n");
+ return;
+ }
VectorCopy (ent->fields.client->origin, end);
end[2] -= 256;
i = (int)PRVM_G_FLOAT(OFS_PARM0);
c = PRVM_G_STRING(OFS_PARM1);
if (i >= cl.max_lightstyle)
- PF_WARNING("VM_CL_lightstyle >= MAX_LIGHTSTYLES\n");
+ {
+ VM_Warning("VM_CL_lightstyle >= MAX_LIGHTSTYLES\n");
+ return;
+ }
strlcpy (cl.lightstyle[i].map, MSG_ReadString(), sizeof (cl.lightstyle[i].map));
cl.lightstyle[i].map[MAX_STYLESTRING - 1] = 0;
cl.lightstyle[i].length = (int)strlen(cl.lightstyle[i].map);
ent = PRVM_G_EDICT(OFS_PARM0);
if (ent == prog->edicts)
- PF_WARNING("changeyaw: can not modify world entity\n");
+ {
+ VM_Warning("changeyaw: can not modify world entity\n");
+ return;
+ }
if (ent->priv.server->free)
- PF_WARNING("changeyaw: can not modify free entity\n");
+ {
+ VM_Warning("changeyaw: can not modify free entity\n");
+ return;
+ }
current = ANGLEMOD(ent->fields.client->angles[1]);
ideal = PRVM_G_FLOAT(OFS_PARM1);
speed = PRVM_G_FLOAT(OFS_PARM2);
ent = PRVM_G_EDICT(OFS_PARM0);
if (ent == prog->edicts)
- PF_WARNING("changepitch: can not modify world entity\n");
+ {
+ VM_Warning("changepitch: can not modify world entity\n");
+ return;
+ }
if (ent->priv.server->free)
- PF_WARNING("changepitch: can not modify free entity\n");
+ {
+ VM_Warning("changepitch: can not modify free entity\n");
+ return;
+ }
current = ANGLEMOD( ent->fields.client->angles[0] );
ideal = PRVM_G_FLOAT(OFS_PARM1);
speed = PRVM_G_FLOAT(OFS_PARM2);
ent = PRVM_G_EDICT(OFS_PARM0);
if (ent == prog->edicts)
- PF_WARNING("tracetoss: can not use world entity\n");
+ {
+ VM_Warning("tracetoss: can not use world entity\n");
+ return;
+ }
ignore = PRVM_G_EDICT(OFS_PARM1);
//FIXME
case VF_CL_VIEWANGLES_Z:cl.viewangles[2] = k;
break;
- default: Con_Printf("VM_R_SetView : unknown parm %i\n", c);
- PRVM_G_FLOAT(OFS_RETURN) = 0;
+ default: PRVM_G_FLOAT(OFS_RETURN) = 0;
+ VM_Warning("VM_R_SetView : unknown parm %i\n", c);
return;
}
PRVM_G_FLOAT(OFS_RETURN) = 1;
i = (int)PRVM_G_FLOAT(OFS_PARM0);
if(i < 0 || i >= MAX_CL_STATS)
{
- Con_Printf("VM_CL_getstatf: index>=MAX_CL_STATS or index<0\n");
+ VM_Warning("VM_CL_getstatf: index>=MAX_CL_STATS or index<0\n");
return;
}
dat.l = cl.stats[i];
if(index < 0 || index >= MAX_CL_STATS)
{
- Con_Printf("VM_CL_getstati: index>=MAX_CL_STATS or index<0\n");
+ VM_Warning("VM_CL_getstati: index>=MAX_CL_STATS or index<0\n");
return;
}
i = cl.stats[index];
i = (int)PRVM_G_FLOAT(OFS_PARM0);
if(i < 0 || i > MAX_CL_STATS-4)
{
- Con_Printf("VM_CL_getstats: index>MAX_CL_STATS-4 or index<0\n");
+ VM_Warning("VM_CL_getstats: index>MAX_CL_STATS-4 or index<0\n");
return;
}
t = VM_GetTempString();
{
i = -(i+1);
if(i >= MAX_MODELS)
- PF_WARNING("VM_CL_setmodelindex >= MAX_MODELS\n");
+ {
+ VM_Warning("VM_CL_setmodelindex >= MAX_MODELS\n");
+ return;
+ }
m = cl.csqc_model_precache[i];
}
else
if(i >= MAX_MODELS)
- PF_WARNING("VM_CL_setmodelindex >= MAX_MODELS\n");
+ {
+ VM_Warning("VM_CL_setmodelindex >= MAX_MODELS\n");
+ return;
+ }
else
m = cl.model_precache[i];
if(!m)
- PF_WARNING("VM_CL_setmodelindex: null model\n");
+ {
+ VM_Warning("VM_CL_setmodelindex: null model\n");
+ return;
+ }
t->fields.client->model = PRVM_SetEngineString(m->name);
t->fields.client->modelindex = i;
}
{
i = -(i+1);
if(i >= MAX_MODELS)
- PF_WARNING("VM_CL_modelnameforindex >= MAX_MODELS\n");
+ {
+ VM_Warning("VM_CL_modelnameforindex >= MAX_MODELS\n");
+ return;
+ }
if(cl.csqc_model_precache[i])
PRVM_G_INT(OFS_RETURN) = PRVM_SetEngineString(cl.csqc_model_precache[i]->name);
return;
}
if(i >= MAX_MODELS)
- PF_WARNING("VM_CL_modelnameforindex >= MAX_MODELS\n");
+ {
+ VM_Warning("VM_CL_modelnameforindex >= MAX_MODELS\n");
+ return;
+ }
if(cl.model_precache[i])
PRVM_G_INT(OFS_RETURN) = PRVM_SetEngineString(cl.model_precache[i]->name);
}
if (entnum >= MAX_EDICTS)
{
- Con_Printf("CSQC_ParseBeam: invalid entity number %i\n", entnum);
+ VM_Warning("CSQC_ParseBeam: invalid entity number %i\n", entnum);
return;
}
if (entnum >= cl.max_csqcentities)
model_t *model;
if (e == prog->edicts)
- PF_WARNING("setattachment: can not modify world entity\n");
+ {
+ VM_Warning("setattachment: can not modify world entity\n");
+ return;
+ }
if (e->priv.server->free)
- PF_WARNING("setattachment: can not modify free entity\n");
+ {
+ VM_Warning("setattachment: can not modify free entity\n");
+ return;
+ }
if (tagentity == NULL)
tagentity = prog->edicts;
int modelindex, tag_index;
if (ent == prog->edicts)
- PF_WARNING("gettagindex: can't affect world entity\n");
+ {
+ VM_Warning("gettagindex: can't affect world entity\n");
+ return;
+ }
if (ent->priv.server->free)
- PF_WARNING("gettagindex: can't affect free entity\n");
+ {
+ VM_Warning("gettagindex: can't affect free entity\n");
+ return;
+ }
modelindex = (int)ent->fields.client->modelindex;
if(modelindex < 0)
switch(returncode)
{
case 1:
- PF_WARNING("gettagindex: can't affect world entity\n");
+ VM_Warning("gettagindex: can't affect world entity\n");
break;
case 2:
- PF_WARNING("gettagindex: can't affect free entity\n");
+ VM_Warning("gettagindex: can't affect free entity\n");
break;
case 3:
Con_DPrintf("CL_GetTagMatrix(entity #%i): null or non-precached model\n", PRVM_NUM_FOR_EDICT(e));
if((csqcents && ignore > cl.num_csqcentities) || (!csqcents && ignore > cl.num_entities))
{
- Con_Printf("VM_CL_selecttraceline: out of entities\n");
+ VM_Warning("VM_CL_selecttraceline: out of entities\n");
return;
}
else
VM_CheckEmptyString (s);
if(snd_initialized.integer && !S_PrecacheSound (s,true, true))
- Con_Printf("VM_precache_sound: Failed to load %s for %s\n", s, PRVM_NAME);
+ {
+ VM_Warning("VM_precache_sound: Failed to load %s for %s\n", s, PRVM_NAME);
+ return;
+ }
}
/*
VM_SAFEPARMCOUNT(2, VM_M_writetofile);
file = VM_GetFileHandle( (int)PRVM_G_FLOAT(OFS_PARM0) );
- if( !file ) {
+ if( !file )
+ {
+ VM_Warning("VM_M_writetofile: invalid or closed file handle\n");
return;
}
ent = PRVM_G_EDICT(OFS_PARM1);
if(ent->priv.required->free)
{
- Con_Printf("VM_M_writetofile: %s: entity %i is free !\n", PRVM_NAME, PRVM_EDICT_NUM(OFS_PARM1));
+ VM_Warning("VM_M_writetofile: %s: entity %i is free !\n", PRVM_NAME, PRVM_EDICT_NUM(OFS_PARM1));
return;
}
PRVM_G_FLOAT ( OFS_RETURN ) = serverlist_sortdescending;
return;
default:
- Con_Printf( "VM_M_getserverliststat: bad type %i!\n", type );
+ VM_Warning( "VM_M_getserverliststat: bad type %i!\n", type );
}
}
mask = &serverlist_andmasks[masknr];
else if( masknr >= 512 && masknr - 512 <= SERVERLIST_ORMASKCOUNT )
mask = &serverlist_ormasks[masknr - 512 ];
- else {
- Con_Printf( "VM_M_setserverlistmaskstring: invalid mask number %i\n", masknr );
+ else
+ {
+ VM_Warning( "VM_M_setserverlistmaskstring: invalid mask number %i\n", masknr );
return;
}
strncpy( mask->info.game, PRVM_G_STRING( OFS_PARM2 ), sizeof(mask->info.game) );
break;
default:
- Con_Printf( "VM_M_setserverlistmaskstring: Bad field number %i passed!\n", field );
+ VM_Warning( "VM_M_setserverlistmaskstring: Bad field number %i passed!\n", field );
return;
}
mask = &serverlist_andmasks[masknr];
else if( masknr >= 512 && masknr - 512 <= SERVERLIST_ORMASKCOUNT )
mask = &serverlist_ormasks[masknr - 512 ];
- else {
- Con_Printf( "VM_M_setserverlistmasknumber: invalid mask number %i\n", masknr );
+ else
+ {
+ VM_Warning( "VM_M_setserverlistmasknumber: invalid mask number %i\n", masknr );
return;
}
mask->info.protocol = number;
break;
default:
- Con_Printf( "VM_M_setserverlistmasknumber: Bad field number %i passed!\n", field );
+ VM_Warning( "VM_M_setserverlistmasknumber: Bad field number %i passed!\n", field );
return;
}
int PRVM_GetProgNr(void);
+void VM_Warning(const char *fmt, ...);
// TODO: fill in the params
//void PRVM_Create();
#include "prvm_cmds.h"
+// LordHavoc: changed this to NOT use a return statement, so that it can be used in functions that must return a value
+void VM_Warning(const char *fmt, ...)
+{
+ va_list argptr;
+ char msg[MAX_INPUTLINE];
+
+ va_start(argptr,fmt);
+ dpvsnprintf(msg,sizeof(msg),fmt,argptr);
+ va_end(argptr);
+
+ Con_Print(msg);
+ PRVM_PrintState();
+}
+
+
//============================================================================
// Common
PRVM_ED_Print(ed);
}
- PRVM_ERROR ("%s: Program error in function %s:\n%s\n", PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string);
+ PRVM_ERROR ("%s: Program error in function %s:\n%s\nTip: read above for entity information\n", PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string);
}
/*
else
// objerror has to display the object fields -> else call
PRVM_ERROR ("VM_objecterror: self not defined !");
- Con_Printf("%s OBJECT ERROR in %s:\n%s\n", PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string);
+ Con_Printf("%s OBJECT ERROR in %s:\n%s\nTip: read above for entity information\n", PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string);
}
/*
if(!sv.active)
{
- Con_Printf("VM_bprint: game is not server(%s) !\n", PRVM_NAME);
+ VM_Warning("VM_bprint: game is not server(%s) !\n", PRVM_NAME);
return;
}
clientnum = (int)PRVM_G_FLOAT(OFS_PARM0);
if (!sv.active || clientnum < 0 || clientnum >= svs.maxclients || !svs.clients[clientnum].active)
{
- Con_Printf("VM_sprint: %s: invalid client or server is not active !\n", PRVM_NAME);
+ VM_Warning("VM_sprint: %s: invalid client or server is not active !\n", PRVM_NAME);
return;
}
if(!S_LocalSound (s))
{
- Con_Printf("VM_localsound: Failed to play %s for %s !\n", s, PRVM_NAME);
PRVM_G_FLOAT(OFS_RETURN) = -4;
+ VM_Warning("VM_localsound: Failed to play %s for %s !\n", s, PRVM_NAME);
return;
}
if(!sv.active)
{
- Con_Printf("VM_changelevel: game is not server (%s)\n", PRVM_NAME);
+ VM_Warning("VM_changelevel: game is not server (%s)\n", PRVM_NAME);
return;
}
// check for overlap with a command
if (Cmd_Exists (name))
{
- Con_Printf("VM_registercvar: %s is a command\n", name);
+ VM_Warning("VM_registercvar: %s is a command\n", name);
return;
}
break;
if (filenum >= MAX_VMFILES)
{
- Con_Printf("VM_fopen: %s ran out of file handles (%i)\n", PRVM_NAME, MAX_VMFILES);
PRVM_G_FLOAT(OFS_RETURN) = -2;
+ VM_Warning("VM_fopen: %s ran out of file handles (%i)\n", PRVM_NAME, MAX_VMFILES);
return;
}
mode = (int)PRVM_G_FLOAT(OFS_PARM1);
modestring = "wb";
break;
default:
- Con_Printf("VM_fopen: %s: no such mode %i (valid: 0 = read, 1 = append, 2 = write)\n", PRVM_NAME, mode);
PRVM_G_FLOAT(OFS_RETURN) = -3;
+ VM_Warning("VM_fopen: %s: no such mode %i (valid: 0 = read, 1 = append, 2 = write)\n", PRVM_NAME, mode);
return;
}
filename = PRVM_G_STRING(OFS_PARM0);
if (VM_FILES[filenum] == NULL)
{
- if (developer.integer >= 10)
- Con_Printf("VM_fopen: %s: %s mode %s failed\n", PRVM_NAME, filename, modestring);
PRVM_G_FLOAT(OFS_RETURN) = -1;
+ if (developer.integer >= 10)
+ VM_Warning("VM_fopen: %s: %s mode %s failed\n", PRVM_NAME, filename, modestring);
}
else
{
- if (developer.integer >= 10)
- Con_Printf("VM_fopen: %s: %s mode %s opened as #%i\n", PRVM_NAME, filename, modestring, filenum);
PRVM_G_FLOAT(OFS_RETURN) = filenum;
+ if (developer.integer >= 10)
+ VM_Warning("VM_fopen: %s: %s mode %s opened as #%i\n", PRVM_NAME, filename, modestring, filenum);
}
}
filenum = (int)PRVM_G_FLOAT(OFS_PARM0);
if (filenum < 0 || filenum >= MAX_VMFILES)
{
- Con_Printf("VM_fclose: invalid file handle %i used in %s\n", filenum, PRVM_NAME);
+ VM_Warning("VM_fclose: invalid file handle %i used in %s\n", filenum, PRVM_NAME);
return;
}
if (VM_FILES[filenum] == NULL)
{
- Con_Printf("VM_fclose: no such file handle %i (or file has been closed) in %s\n", filenum, PRVM_NAME);
+ VM_Warning("VM_fclose: no such file handle %i (or file has been closed) in %s\n", filenum, PRVM_NAME);
return;
}
- if (developer.integer >= 10)
- Con_Printf("VM_fclose: %s: #%i closed\n", PRVM_NAME, filenum);
FS_Close(VM_FILES[filenum]);
VM_FILES[filenum] = NULL;
+ if (developer.integer >= 10)
+ VM_Warning("VM_fclose: %s: #%i closed\n", PRVM_NAME, filenum);
}
/*
filenum = (int)PRVM_G_FLOAT(OFS_PARM0);
if (filenum < 0 || filenum >= MAX_VMFILES)
{
- Con_Printf("VM_fgets: invalid file handle %i used in %s\n", filenum, PRVM_NAME);
+ VM_Warning("VM_fgets: invalid file handle %i used in %s\n", filenum, PRVM_NAME);
return;
}
if (VM_FILES[filenum] == NULL)
{
- Con_Printf("VM_fgets: no such file handle %i (or file has been closed) in %s\n", filenum, PRVM_NAME);
+ VM_Warning("VM_fgets: no such file handle %i (or file has been closed) in %s\n", filenum, PRVM_NAME);
return;
}
end = 0;
filenum = (int)PRVM_G_FLOAT(OFS_PARM0);
if (filenum < 0 || filenum >= MAX_VMFILES)
{
- Con_Printf("VM_fputs: invalid file handle %i used in %s\n", filenum, PRVM_NAME);
+ VM_Warning("VM_fputs: invalid file handle %i used in %s\n", filenum, PRVM_NAME);
return;
}
if (VM_FILES[filenum] == NULL)
{
- Con_Printf("VM_fputs: no such file handle %i (or file has been closed) in %s\n", filenum, PRVM_NAME);
+ VM_Warning("VM_fputs: no such file handle %i (or file has been closed) in %s\n", filenum, PRVM_NAME);
return;
}
VM_VarString(1, string, sizeof(string));
i = (int)PRVM_G_FLOAT(OFS_PARM0);
if (!sv.active || i < 0 || i >= svs.maxclients || !svs.clients[i].active)
{
- Con_Printf("VM_clientcommand: %s: invalid client/server is not active !\n", PRVM_NAME);
+ VM_Warning("VM_clientcommand: %s: invalid client/server is not active !\n", PRVM_NAME);
return;
}
// \ 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, '\\'))
{
- Con_Printf("VM_loadfromfile: %s dangerous or non-portable filename \"%s\" not allowed. (contains : or \\ or begins with .. or /)\n", PRVM_NAME, filename);
PRVM_G_FLOAT(OFS_RETURN) = -4;
+ VM_Warning("VM_loadfromfile: %s dangerous or non-portable filename \"%s\" not allowed. (contains : or \\ or begins with .. or /)\n", PRVM_NAME, filename);
return;
}
if(handle >= MAX_VMSEARCHES)
{
- Con_Printf("VM_search_begin: %s ran out of search handles (%i)\n", PRVM_NAME, MAX_VMSEARCHES);
PRVM_G_FLOAT(OFS_RETURN) = -2;
+ VM_Warning("VM_search_begin: %s ran out of search handles (%i)\n", PRVM_NAME, MAX_VMSEARCHES);
return;
}
if(handle < 0 || handle >= MAX_VMSEARCHES)
{
- Con_Printf("VM_search_end: invalid handle %i used in %s\n", handle, PRVM_NAME);
+ VM_Warning("VM_search_end: invalid handle %i used in %s\n", handle, PRVM_NAME);
return;
}
if(VM_SEARCHLIST[handle] == NULL)
{
- Con_Printf("VM_search_end: no such handle %i in %s\n", handle, PRVM_NAME);
+ VM_Warning("VM_search_end: no such handle %i in %s\n", handle, PRVM_NAME);
return;
}
if(handle < 0 || handle >= MAX_VMSEARCHES)
{
- Con_Printf("VM_search_getsize: invalid handle %i used in %s\n", handle, PRVM_NAME);
+ VM_Warning("VM_search_getsize: invalid handle %i used in %s\n", handle, PRVM_NAME);
return;
}
if(VM_SEARCHLIST[handle] == NULL)
{
- Con_Printf("VM_search_getsize: no such handle %i in %s\n", handle, PRVM_NAME);
+ VM_Warning("VM_search_getsize: no such handle %i in %s\n", handle, PRVM_NAME);
return;
}
if(handle < 0 || handle >= MAX_VMSEARCHES)
{
- Con_Printf("VM_search_getfilename: invalid handle %i used in %s\n", handle, PRVM_NAME);
+ VM_Warning("VM_search_getfilename: invalid handle %i used in %s\n", handle, PRVM_NAME);
return;
}
if(VM_SEARCHLIST[handle] == NULL)
{
- Con_Printf("VM_search_getfilename: no such handle %i in %s\n", handle, PRVM_NAME);
+ VM_Warning("VM_search_getfilename: no such handle %i in %s\n", handle, PRVM_NAME);
return;
}
if(filenum < 0 || filenum >= VM_SEARCHLIST[handle]->numfilenames)
{
- Con_Printf("VM_search_getfilename: invalid filenum %i in %s\n", filenum, PRVM_NAME);
+ VM_Warning("VM_search_getfilename: invalid filenum %i in %s\n", filenum, PRVM_NAME);
return;
}
character = (char) PRVM_G_FLOAT(OFS_PARM1);
if(character == 0)
{
- Con_Printf("VM_drawcharacter: %s passed null character !\n",PRVM_NAME);
PRVM_G_FLOAT(OFS_RETURN) = -1;
+ VM_Warning("VM_drawcharacter: %s passed null character !\n",PRVM_NAME);
return;
}
if(flag < DRAWFLAG_NORMAL || flag >=DRAWFLAG_NUMFLAGS)
{
- Con_Printf("VM_drawcharacter: %s: wrong DRAWFLAG %i !\n",PRVM_NAME,flag);
PRVM_G_FLOAT(OFS_RETURN) = -2;
+ VM_Warning("VM_drawcharacter: %s: wrong DRAWFLAG %i !\n",PRVM_NAME,flag);
return;
}
if(!scale[0] || !scale[1])
{
- Con_Printf("VM_drawcharacter: scale %s is null !\n", (scale[0] == 0) ? ((scale[1] == 0) ? "x and y" : "x") : "y");
PRVM_G_FLOAT(OFS_RETURN) = -3;
+ VM_Warning("VM_drawcharacter: scale %s is null !\n", (scale[0] == 0) ? ((scale[1] == 0) ? "x and y" : "x") : "y");
return;
}
string = PRVM_G_STRING(OFS_PARM1);
if(!string)
{
- Con_Printf("VM_drawstring: %s passed null string !\n",PRVM_NAME);
PRVM_G_FLOAT(OFS_RETURN) = -1;
+ VM_Warning("VM_drawstring: %s passed null string !\n",PRVM_NAME);
return;
}
if(flag < DRAWFLAG_NORMAL || flag >=DRAWFLAG_NUMFLAGS)
{
- Con_Printf("VM_drawstring: %s: wrong DRAWFLAG %i !\n",PRVM_NAME,flag);
PRVM_G_FLOAT(OFS_RETURN) = -2;
+ VM_Warning("VM_drawstring: %s: wrong DRAWFLAG %i !\n",PRVM_NAME,flag);
return;
}
if(!scale[0] || !scale[1])
{
- Con_Printf("VM_drawstring: scale %s is null !\n", (scale[0] == 0) ? ((scale[1] == 0) ? "x and y" : "x") : "y");
PRVM_G_FLOAT(OFS_RETURN) = -3;
+ VM_Warning("VM_drawstring: scale %s is null !\n", (scale[0] == 0) ? ((scale[1] == 0) ? "x and y" : "x") : "y");
return;
}
if(!picname)
{
- Con_Printf("VM_drawpic: %s passed null picture name !\n", PRVM_NAME);
PRVM_G_FLOAT(OFS_RETURN) = -1;
+ VM_Warning("VM_drawpic: %s passed null picture name !\n", PRVM_NAME);
return;
}
// is pic cached ? no function yet for that
if(!1)
{
- Con_Printf("VM_drawpic: %s: %s not cached !\n", PRVM_NAME, picname);
PRVM_G_FLOAT(OFS_RETURN) = -4;
+ VM_Warning("VM_drawpic: %s: %s not cached !\n", PRVM_NAME, picname);
return;
}
if(flag < DRAWFLAG_NORMAL || flag >=DRAWFLAG_NUMFLAGS)
{
- Con_Printf("VM_drawstring: %s: wrong DRAWFLAG %i !\n",PRVM_NAME,flag);
PRVM_G_FLOAT(OFS_RETURN) = -2;
+ VM_Warning("VM_drawstring: %s: wrong DRAWFLAG %i !\n",PRVM_NAME,flag);
return;
}
if(flag < DRAWFLAG_NORMAL || flag >=DRAWFLAG_NUMFLAGS)
{
- Con_Printf("VM_drawstring: %s: wrong DRAWFLAG %i !\n",PRVM_NAME,flag);
PRVM_G_FLOAT(OFS_RETURN) = -2;
+ VM_Warning("VM_drawstring: %s: wrong DRAWFLAG %i !\n",PRVM_NAME,flag);
return;
}
VM_InitPolygons();
if(vm_polygonbegin)
{
- Con_Printf("VM_R_PolygonBegin: called twice without VM_R_PolygonEnd after first\n");
+ VM_Warning("VM_R_PolygonBegin: called twice without VM_R_PolygonEnd after first\n");
return;
}
if(vm_drawpolygons_num >= vm_polygons_num)
if(!vm_polygonbegin)
{
- Con_Printf("VM_R_PolygonVertex: VM_R_PolygonBegin wasn't called\n");
+ VM_Warning("VM_R_PolygonVertex: VM_R_PolygonBegin wasn't called\n");
return;
}
coords = PRVM_G_VECTOR(OFS_PARM0);
p = &vm_polygons[vm_drawpolygons_num];
if(vm_current_vertices > 4)
{
- Con_Printf("VM_R_PolygonVertex: may have 4 vertices max\n");
+ VM_Warning("VM_R_PolygonVertex: may have 4 vertices max\n");
return;
}
{
if(!vm_polygonbegin)
{
- Con_Printf("VM_R_PolygonEnd: VM_R_PolygonBegin wasn't called\n");
+ VM_Warning("VM_R_PolygonEnd: VM_R_PolygonBegin wasn't called\n");
return;
}
+ vm_polygonbegin = false;
if(vm_current_vertices > 2 || (vm_current_vertices >= 2 && vm_polygons[vm_drawpolygons_num].flags & VM_POLYGON_FLLINES))
{
if(vm_polygons[vm_drawpolygons_num].flags & VM_POLYGON_FL2D) //[515]: don't use qcpolygons memory if 2D
vm_drawpolygons_num++;
}
else
- Con_Printf("VM_R_PolygonEnd: %i vertices isn't a good choice\n", vm_current_vertices);
- vm_polygonbegin = false;
+ VM_Warning("VM_R_PolygonEnd: %i vertices isn't a good choice\n", vm_current_vertices);
}
void VM_AddPolygonsToMeshQueue (void)
BufStr_ClearBuffer((int)PRVM_G_FLOAT(OFS_PARM0));
else
{
- Con_Printf("VM_buf_del: invalid buffer %i used in %s\n", (int)PRVM_G_FLOAT(OFS_PARM0), PRVM_NAME);
+ VM_Warning("VM_buf_del: invalid buffer %i used in %s\n", (int)PRVM_G_FLOAT(OFS_PARM0), PRVM_NAME);
return;
}
}
if(!b)
{
PRVM_G_FLOAT(OFS_RETURN) = -1;
- Con_Printf("VM_buf_getsize: invalid buffer %i used in %s\n", (int)PRVM_G_FLOAT(OFS_PARM0), PRVM_NAME);
+ VM_Warning("VM_buf_getsize: invalid buffer %i used in %s\n", (int)PRVM_G_FLOAT(OFS_PARM0), PRVM_NAME);
return;
}
else
b1 = BUFSTR_BUFFER((int)PRVM_G_FLOAT(OFS_PARM0));
if(!b1)
{
- Con_Printf("VM_buf_copy: invalid source buffer %i used in %s\n", (int)PRVM_G_FLOAT(OFS_PARM0), PRVM_NAME);
+ VM_Warning("VM_buf_copy: invalid source buffer %i used in %s\n", (int)PRVM_G_FLOAT(OFS_PARM0), PRVM_NAME);
return;
}
i = (int)PRVM_G_FLOAT(OFS_PARM1);
if(i == (int)PRVM_G_FLOAT(OFS_PARM0))
{
- Con_Printf("VM_buf_copy: source == destination (%i) in %s\n", i, PRVM_NAME);
+ VM_Warning("VM_buf_copy: source == destination (%i) in %s\n", i, PRVM_NAME);
return;
}
b2 = BUFSTR_BUFFER(i);
if(!b2)
{
- Con_Printf("VM_buf_copy: invalid destination buffer %i used in %s\n", (int)PRVM_G_FLOAT(OFS_PARM1), PRVM_NAME);
+ VM_Warning("VM_buf_copy: invalid destination buffer %i used in %s\n", (int)PRVM_G_FLOAT(OFS_PARM1), PRVM_NAME);
return;
}
b2->strings[i] = (char *)Z_Malloc(strlen(b1->strings[i])+1);
if(!b2->strings[i])
{
- Con_Printf("VM_buf_copy: not enough memory for buffer %i used in %s\n", (int)PRVM_G_FLOAT(OFS_PARM1), PRVM_NAME);
+ VM_Warning("VM_buf_copy: not enough memory for buffer %i used in %s\n", (int)PRVM_G_FLOAT(OFS_PARM1), PRVM_NAME);
break;
}
strcpy(b2->strings[i], b1->strings[i]);
b = BUFSTR_BUFFER((int)PRVM_G_FLOAT(OFS_PARM0));
if(!b)
{
- Con_Printf("VM_buf_sort: invalid buffer %i used in %s\n", (int)PRVM_G_FLOAT(OFS_PARM0), PRVM_NAME);
+ VM_Warning("VM_buf_sort: invalid buffer %i used in %s\n", (int)PRVM_G_FLOAT(OFS_PARM0), PRVM_NAME);
return;
}
if(b->num_strings <= 0)
{
- Con_Printf("VM_buf_sort: tried to sort empty buffer %i in %s\n", (int)PRVM_G_FLOAT(OFS_PARM0), PRVM_NAME);
+ VM_Warning("VM_buf_sort: tried to sort empty buffer %i in %s\n", (int)PRVM_G_FLOAT(OFS_PARM0), PRVM_NAME);
return;
}
buf_sortpower = (int)PRVM_G_FLOAT(OFS_PARM1);
PRVM_G_INT(OFS_RETURN) = 0;
if(!b)
{
- Con_Printf("VM_buf_implode: invalid buffer %i used in %s\n", (int)PRVM_G_FLOAT(OFS_PARM0), PRVM_NAME);
+ VM_Warning("VM_buf_implode: invalid buffer %i used in %s\n", (int)PRVM_G_FLOAT(OFS_PARM0), PRVM_NAME);
return;
}
if(!b->num_strings)
b = BUFSTR_BUFFER((int)PRVM_G_FLOAT(OFS_PARM0));
if(!b)
{
- Con_Printf("VM_bufstr_get: invalid buffer %i used in %s\n", (int)PRVM_G_FLOAT(OFS_PARM0), PRVM_NAME);
+ VM_Warning("VM_bufstr_get: invalid buffer %i used in %s\n", (int)PRVM_G_FLOAT(OFS_PARM0), PRVM_NAME);
return;
}
strindex = (int)PRVM_G_FLOAT(OFS_PARM1);
if(strindex < 0 || strindex > MAX_QCSTR_STRINGS)
{
- Con_Printf("VM_bufstr_get: invalid string index %i used in %s\n", strindex, PRVM_NAME);
+ VM_Warning("VM_bufstr_get: invalid string index %i used in %s\n", strindex, PRVM_NAME);
return;
}
PRVM_G_INT(OFS_RETURN) = 0;
b = BUFSTR_BUFFER(bufindex);
if(!b)
{
- Con_Printf("VM_bufstr_set: invalid buffer %i used in %s\n", bufindex, PRVM_NAME);
+ VM_Warning("VM_bufstr_set: invalid buffer %i used in %s\n", bufindex, PRVM_NAME);
return;
}
strindex = (int)PRVM_G_FLOAT(OFS_PARM1);
if(strindex < 0 || strindex > MAX_QCSTR_STRINGS)
{
- Con_Printf("VM_bufstr_set: invalid string index %i used in %s\n", strindex, PRVM_NAME);
+ VM_Warning("VM_bufstr_set: invalid string index %i used in %s\n", strindex, PRVM_NAME);
return;
}
news = PRVM_G_STRING(OFS_PARM2);
if(!news)
{
- Con_Printf("VM_bufstr_set: null string used in %s\n", PRVM_NAME);
+ VM_Warning("VM_bufstr_set: null string used in %s\n", PRVM_NAME);
return;
}
if(b->strings[strindex])
PRVM_G_FLOAT(OFS_RETURN) = -1;
if(!b)
{
- Con_Printf("VM_bufstr_add: invalid buffer %i used in %s\n", bufindex, PRVM_NAME);
+ VM_Warning("VM_bufstr_add: invalid buffer %i used in %s\n", bufindex, PRVM_NAME);
return;
}
string = PRVM_G_STRING(OFS_PARM1);
if(!string)
{
- Con_Printf("VM_bufstr_add: null string used in %s\n", PRVM_NAME);
+ VM_Warning("VM_bufstr_add: null string used in %s\n", PRVM_NAME);
return;
}
strindex = BufStr_FindFreeString(b);
if(strindex < 0)
{
- Con_Printf("VM_bufstr_add: buffer %i has no free string slots in %s\n", bufindex, PRVM_NAME);
+ VM_Warning("VM_bufstr_add: buffer %i has no free string slots in %s\n", bufindex, PRVM_NAME);
return;
}
}
{
if(b->num_strings == MAX_QCSTR_STRINGS)
{
- Con_Printf("VM_bufstr_add: buffer %i has no free string slots in %s\n", bufindex, PRVM_NAME);
+ VM_Warning("VM_bufstr_add: buffer %i has no free string slots in %s\n", bufindex, PRVM_NAME);
return;
}
b->strings[b->num_strings] = NULL;
b = BUFSTR_BUFFER((int)PRVM_G_FLOAT(OFS_PARM0));
if(!b)
{
- Con_Printf("VM_bufstr_free: invalid buffer %i used in %s\n", (int)PRVM_G_FLOAT(OFS_PARM0), PRVM_NAME);
+ VM_Warning("VM_bufstr_free: invalid buffer %i used in %s\n", (int)PRVM_G_FLOAT(OFS_PARM0), PRVM_NAME);
return;
}
i = (int)PRVM_G_FLOAT(OFS_PARM1);
if(i < 0 || i > MAX_QCSTR_STRINGS)
{
- Con_Printf("VM_bufstr_free: invalid string index %i used in %s\n", i, PRVM_NAME);
+ VM_Warning("VM_bufstr_free: invalid string index %i used in %s\n", i, PRVM_NAME);
return;
}
if(b->strings[i])
//============================================================================
// Server
-#define PF_WARNING(s) do{Con_Printf(s);PRVM_PrintState();return;}while(0)
cvar_t sv_aim = {CVAR_SAVE, "sv_aim", "2", "maximum cosine angle for quake's vertical autoaim, a value above 1 completely disables the autoaim, quake used 0.93"}; //"0.93"}; // LordHavoc: disabled autoaim by default
e = PRVM_G_EDICT(OFS_PARM0);
if (e == prog->edicts)
- PF_WARNING("setorigin: can not modify world entity\n");
+ {
+ VM_Warning("setorigin: can not modify world entity\n");
+ return;
+ }
if (e->priv.server->free)
- PF_WARNING("setorigin: can not modify free entity\n");
+ {
+ VM_Warning("setorigin: can not modify free entity\n");
+ return;
+ }
org = PRVM_G_VECTOR(OFS_PARM1);
VectorCopy (org, e->fields.server->origin);
SV_LinkEdict (e, false);
e = PRVM_G_EDICT(OFS_PARM0);
if (e == prog->edicts)
- PF_WARNING("setsize: can not modify world entity\n");
+ {
+ VM_Warning("setsize: can not modify world entity\n");
+ return;
+ }
if (e->priv.server->free)
- PF_WARNING("setsize: can not modify free entity\n");
+ {
+ VM_Warning("setsize: can not modify free entity\n");
+ return;
+ }
min = PRVM_G_VECTOR(OFS_PARM1);
max = PRVM_G_VECTOR(OFS_PARM2);
SetMinMaxSize (e, min, max, false);
e = PRVM_G_EDICT(OFS_PARM0);
if (e == prog->edicts)
- PF_WARNING("setmodel: can not modify world entity\n");
+ {
+ VM_Warning("setmodel: can not modify world entity\n");
+ return;
+ }
if (e->priv.server->free)
- PF_WARNING("setmodel: can not modify free entity\n");
+ {
+ VM_Warning("setmodel: can not modify free entity\n");
+ return;
+ }
i = SV_ModelIndex(PRVM_G_STRING(OFS_PARM1), 1);
e->fields.server->model = PRVM_SetEngineString(sv.model_precache[i]);
e->fields.server->modelindex = i;
entnum = PRVM_G_EDICTNUM(OFS_PARM0);
if (entnum < 1 || entnum > svs.maxclients || !svs.clients[entnum-1].active)
- PF_WARNING("tried to centerprint to a non-client\n");
+ {
+ VM_Warning("tried to centerprint to a non-client\n");
+ return;
+ }
client = svs.clients + entnum-1;
if (!client->netconnection)
entnum = PRVM_G_EDICTNUM(OFS_PARM0);
if (entnum < 1 || entnum > svs.maxclients || !svs.clients[entnum-1].active)
- PF_WARNING("tried to centerprint to a non-client\n");
+ {
+ VM_Warning("tried to centerprint to a non-client\n");
+ return;
+ }
client = svs.clients + entnum-1;
if (!client->netconnection)
attenuation = PRVM_G_FLOAT(OFS_PARM4);
if (volume < 0 || volume > 255)
- PF_WARNING("SV_StartSound: volume must be in range 0-1\n");
+ {
+ VM_Warning("SV_StartSound: volume must be in range 0-1\n");
+ return;
+ }
if (attenuation < 0 || attenuation > 4)
- PF_WARNING("SV_StartSound: attenuation must be in range 0-4\n");
+ {
+ VM_Warning("SV_StartSound: attenuation must be in range 0-4\n");
+ return;
+ }
if (channel < 0 || channel > 7)
- PF_WARNING("SV_StartSound: channel must be in range 0-7\n");
+ {
+ VM_Warning("SV_StartSound: channel must be in range 0-7\n");
+ return;
+ }
SV_StartSound (entity, channel, sample, volume, attenuation);
}
ent = PRVM_G_EDICT(OFS_PARM0);
if (ent == prog->edicts)
- PF_WARNING("tracetoss: can not use world entity\n");
+ {
+ VM_Warning("tracetoss: can not use world entity\n");
+ return;
+ }
ignore = PRVM_G_EDICT(OFS_PARM1);
trace = SV_Trace_Toss (ent, ignore);
entnum = PRVM_G_EDICTNUM(OFS_PARM0);
if (entnum < 1 || entnum > svs.maxclients || !svs.clients[entnum-1].active)
- PF_WARNING("Can't stuffcmd to a non-client\n");
+ {
+ VM_Warning("Can't stuffcmd to a non-client\n");
+ return;
+ }
VM_VarString(1, string, sizeof(string));
ent = PRVM_PROG_TO_EDICT(prog->globals.server->self);
if (ent == prog->edicts)
- PF_WARNING("walkmove: can not modify world entity\n");
+ {
+ VM_Warning("walkmove: can not modify world entity\n");
+ return;
+ }
if (ent->priv.server->free)
- PF_WARNING("walkmove: can not modify free entity\n");
+ {
+ VM_Warning("walkmove: can not modify free entity\n");
+ return;
+ }
yaw = PRVM_G_FLOAT(OFS_PARM0);
dist = PRVM_G_FLOAT(OFS_PARM1);
ent = PRVM_PROG_TO_EDICT(prog->globals.server->self);
if (ent == prog->edicts)
- PF_WARNING("droptofloor: can not modify world entity\n");
+ {
+ VM_Warning("droptofloor: can not modify world entity\n");
+ return;
+ }
if (ent->priv.server->free)
- PF_WARNING("droptofloor: can not modify free entity\n");
+ {
+ VM_Warning("droptofloor: can not modify free entity\n");
+ return;
+ }
VectorCopy (ent->fields.server->origin, end);
end[2] -= 256;
ent = PRVM_G_EDICT(OFS_PARM0);
if (ent == prog->edicts)
- PF_WARNING("aim: can not use world entity\n");
+ {
+ VM_Warning("aim: can not use world entity\n");
+ return;
+ }
if (ent->priv.server->free)
- PF_WARNING("aim: can not use free entity\n");
+ {
+ VM_Warning("aim: can not use free entity\n");
+ return;
+ }
speed = PRVM_G_FLOAT(OFS_PARM1);
VectorCopy (ent->fields.server->origin, start);
ent = PRVM_PROG_TO_EDICT(prog->globals.server->self);
if (ent == prog->edicts)
- PF_WARNING("changeyaw: can not modify world entity\n");
+ {
+ VM_Warning("changeyaw: can not modify world entity\n");
+ return;
+ }
if (ent->priv.server->free)
- PF_WARNING("changeyaw: can not modify free entity\n");
+ {
+ VM_Warning("changeyaw: can not modify free entity\n");
+ return;
+ }
current = ANGLEMOD(ent->fields.server->angles[1]);
ideal = ent->fields.server->ideal_yaw;
speed = ent->fields.server->yaw_speed;
ent = PRVM_G_EDICT(OFS_PARM0);
if (ent == prog->edicts)
- PF_WARNING("changepitch: can not modify world entity\n");
+ {
+ VM_Warning("changepitch: can not modify world entity\n");
+ return;
+ }
if (ent->priv.server->free)
- PF_WARNING("changepitch: can not modify free entity\n");
+ {
+ VM_Warning("changepitch: can not modify free entity\n");
+ return;
+ }
current = ANGLEMOD( ent->fields.server->angles[0] );
if ((val = PRVM_GETEDICTFIELDVALUE(ent, eval_idealpitch)))
ideal = val->_float;
else
{
- PF_WARNING("PF_changepitch: .float idealpitch and .float pitch_speed must be defined to use changepitch\n");
+ VM_Warning("PF_changepitch: .float idealpitch and .float pitch_speed must be defined to use changepitch\n");
return;
}
if ((val = PRVM_GETEDICTFIELDVALUE(ent, eval_pitch_speed)))
speed = val->_float;
else
{
- PF_WARNING("PF_changepitch: .float idealpitch and .float pitch_speed must be defined to use changepitch\n");
+ VM_Warning("PF_changepitch: .float idealpitch and .float pitch_speed must be defined to use changepitch\n");
return;
}
entnum = PRVM_NUM_FOR_EDICT(ent);
if (entnum < 1 || entnum > svs.maxclients || !svs.clients[entnum-1].active || !svs.clients[entnum-1].netconnection)
{
- Con_Printf ("WriteDest: tried to write to non-client\n");
+ Con_Printf ("WriteDest: tried to write to non-client\n");PRVM_PrintState();
return &sv.reliable_datagram;
}
else
return &svs.clients[entnum-1].netconnection->message;
default:
- Con_Printf ("WriteDest: bad destination\n");
+ Con_Printf ("WriteDest: bad destination\n");PRVM_PrintState();
case MSG_ALL:
return &sv.reliable_datagram;
ent = PRVM_G_EDICT(OFS_PARM0);
if (ent == prog->edicts)
- PF_WARNING("makestatic: can not modify world entity\n");
+ {
+ VM_Warning("makestatic: can not modify world entity\n");
+ return;
+ }
if (ent->priv.server->free)
- PF_WARNING("makestatic: can not modify free entity\n");
+ {
+ VM_Warning("makestatic: can not modify free entity\n");
+ return;
+ }
large = false;
if (ent->fields.server->modelindex >= 256 || ent->fields.server->frame >= 256)
// check for overlap with a command
if (Cmd_Exists (name))
{
- Con_Printf("PF_registercvar: %s is a command\n", name);
+ VM_Warning("PF_registercvar: %s is a command\n", name);
return;
}
vm_autosentstats = (autosentstat_t *)Z_Malloc((MAX_CL_STATS-32) * sizeof(autosentstat_t));
if(!vm_autosentstats)
{
- Con_Printf("PF_SV_AddStat: not enough memory\n");
+ VM_Warning("PF_SV_AddStat: not enough memory\n");
return;
}
}
if(i < 0)
{
- Con_Printf("PF_SV_AddStat: index may not be less than 32\n");
+ VM_Warning("PF_SV_AddStat: index may not be less than 32\n");
return;
}
if(i >= (MAX_CL_STATS-32))
{
- Con_Printf("PF_SV_AddStat: index >= MAX_CL_STATS\n");
+ VM_Warning("PF_SV_AddStat: index >= MAX_CL_STATS\n");
return;
}
if(i > (MAX_CL_STATS-32-4) && type == 1)
{
- Con_Printf("PF_SV_AddStat: index > (MAX_CL_STATS-4) with string\n");
+ VM_Warning("PF_SV_AddStat: index > (MAX_CL_STATS-4) with string\n");
return;
}
vm_autosentstats[i].type = type;
prvm_edict_t *in, *out;
in = PRVM_G_EDICT(OFS_PARM0);
if (in == prog->edicts)
- PF_WARNING("copyentity: can not read world entity\n");
+ {
+ VM_Warning("copyentity: can not read world entity\n");
+ return;
+ }
if (in->priv.server->free)
- PF_WARNING("copyentity: can not read free entity\n");
+ {
+ VM_Warning("copyentity: can not read free entity\n");
+ return;
+ }
out = PRVM_G_EDICT(OFS_PARM1);
if (out == prog->edicts)
- PF_WARNING("copyentity: can not modify world entity\n");
+ {
+ VM_Warning("copyentity: can not modify world entity\n");
+ return;
+ }
if (out->priv.server->free)
- PF_WARNING("copyentity: can not modify free entity\n");
+ {
+ VM_Warning("copyentity: can not modify free entity\n");
+ return;
+ }
memcpy(out->fields.server, in->fields.server, prog->progs->entityfields * 4);
}
const char *s;
s = PRVM_G_STRING(OFS_PARM1);
if (!s || !s[0])
- PF_WARNING("effect: no model specified\n");
+ {
+ VM_Warning("effect: no model specified\n");
+ return;
+ }
i = SV_ModelIndex(s, 1);
if (!i)
- PF_WARNING("effect: model not precached\n");
+ {
+ VM_Warning("effect: model not precached\n");
+ return;
+ }
SV_StartEffect(PRVM_G_VECTOR(OFS_PARM0), i, (int)PRVM_G_FLOAT(OFS_PARM2), (int)PRVM_G_FLOAT(OFS_PARM3), (int)PRVM_G_FLOAT(OFS_PARM4));
}
model_t *model;
if (e == prog->edicts)
- PF_WARNING("setattachment: can not modify world entity\n");
+ {
+ VM_Warning("setattachment: can not modify world entity\n");
+ return;
+ }
if (e->priv.server->free)
- PF_WARNING("setattachment: can not modify free entity\n");
+ {
+ VM_Warning("setattachment: can not modify free entity\n");
+ return;
+ }
if (tagentity == NULL)
tagentity = prog->edicts;
int modelindex, tag_index;
if (ent == prog->edicts)
- PF_WARNING("gettagindex: can't affect world entity\n");
+ {
+ VM_Warning("gettagindex: can't affect world entity\n");
+ return;
+ }
if (ent->priv.server->free)
- PF_WARNING("gettagindex: can't affect free entity\n");
+ {
+ VM_Warning("gettagindex: can't affect free entity\n");
+ return;
+ }
modelindex = (int)ent->fields.server->modelindex;
tag_index = 0;
switch(returncode)
{
case 1:
- PF_WARNING("gettagindex: can't affect world entity\n");
+ VM_Warning("gettagindex: can't affect world entity\n");
break;
case 2:
- PF_WARNING("gettagindex: can't affect free entity\n");
+ VM_Warning("gettagindex: can't affect free entity\n");
break;
case 3:
Con_DPrintf("SV_GetTagMatrix(entity #%i): null or non-precached model\n", PRVM_NUM_FOR_EDICT(e));
client_t *oldhostclient;
clientnum = PRVM_G_EDICTNUM(OFS_PARM0) - 1;
if (clientnum < 0 || clientnum >= svs.maxclients)
- PF_WARNING("dropclient: not a client\n");
+ {
+ VM_Warning("dropclient: not a client\n");
+ return;
+ }
if (!svs.clients[clientnum].active)
- PF_WARNING("dropclient: that client slot is not connected\n");
+ {
+ VM_Warning("dropclient: that client slot is not connected\n");
+ return;
+ }
oldhostclient = host_client;
host_client = svs.clients + clientnum;
SV_DropClient(false);