float *org;
e = G_EDICT(OFS_PARM0);
+ if (e == sv.edicts)
+ Host_Error("setorigin: can not modify world entity\n");
+ if (e->e->free)
+ Host_Error("setorigin: can not modify free entity\n");
org = G_VECTOR(OFS_PARM1);
VectorCopy (org, e->v->origin);
SV_LinkEdict (e, false);
float *min, *max;
e = G_EDICT(OFS_PARM0);
+ if (e == sv.edicts)
+ Host_Error("setsize: can not modify world entity\n");
+ if (e->e->free)
+ Host_Error("setsize: can not modify free entity\n");
min = G_VECTOR(OFS_PARM1);
max = G_VECTOR(OFS_PARM2);
SetMinMaxSize (e, min, max, false);
int i;
e = G_EDICT(OFS_PARM0);
+ if (e == sv.edicts)
+ Host_Error("setmodel: can not modify world entity\n");
+ if (e->e->free)
+ Host_Error("setmodel: can not modify free entity\n");
m = G_STRING(OFS_PARM1);
// check to see if model was properly precached
pr_xfunction->builtinsprofile += 600;
ent = G_EDICT(OFS_PARM0);
+ if (ent == sv.edicts)
+ Host_Error("tracetoss: can not use world entity\n");
ignore = G_EDICT(OFS_PARM1);
trace = SV_Trace_Toss (ent, ignore);
=================
PF_localcmd
-Sends text over to the client's execution buffer
+Sends text to server console
localcmd (string)
=================
Host_Error("remove: tried to remove world\n");
if (NUM_FOR_EDICT(ed) <= svs.maxclients)
Host_Error("remove: tried to remove a client\n");
+ if (ed->e->free)
+ Host_Error("remove: tried to remove an entity that was already removed\n");
ED_Free (ed);
}
int oldself;
ent = PROG_TO_EDICT(pr_global_struct->self);
+ if (ent == sv.edicts)
+ Host_Error("walkmove: can not modify world entity\n");
+ if (ent->e->free)
+ Host_Error("walkmove: can not modify free entity\n");
yaw = G_FLOAT(OFS_PARM0);
dist = G_FLOAT(OFS_PARM1);
trace_t trace;
ent = PROG_TO_EDICT(pr_global_struct->self);
+ if (ent == sv.edicts)
+ Host_Error("droptofloor: can not modify world entity\n");
+ if (ent->e->free)
+ Host_Error("droptofloor: can not modify free entity\n");
VectorCopy (ent->v->origin, end);
end[2] -= 256;
float speed;
ent = G_EDICT(OFS_PARM0);
+ if (ent == sv.edicts)
+ Host_Error("aim: can not use world entity\n");
+ if (ent->e->free)
+ Host_Error("aim: can not use free entity\n");
speed = G_FLOAT(OFS_PARM1);
VectorCopy (ent->v->origin, start);
float ideal, current, move, speed;
ent = PROG_TO_EDICT(pr_global_struct->self);
+ if (ent == sv.edicts)
+ Host_Error("changeyaw: can not modify world entity\n");
+ if (ent->e->free)
+ Host_Error("changeyaw: can not modify free entity\n");
current = ANGLEMOD(ent->v->angles[1]);
ideal = ent->v->ideal_yaw;
speed = ent->v->yaw_speed;
eval_t *val;
ent = G_EDICT(OFS_PARM0);
+ if (ent == sv.edicts)
+ Host_Error("changepitch: can not modify world entity\n");
+ if (ent->e->free)
+ Host_Error("changepitch: can not modify free entity\n");
current = ANGLEMOD( ent->v->angles[0] );
if ((val = GETEDICTFIELDVALUE(ent, eval_idealpitch)))
ideal = val->_float;
ent = PROG_TO_EDICT(pr_global_struct->msg_entity);
entnum = NUM_FOR_EDICT(ent);
if (entnum < 1 || entnum > svs.maxclients || !svs.clients[entnum-1].active)
- Con_Printf("WriteDest: tried to write to non-client\n");
+ Host_Error("WriteDest: tried to write to non-client\n");
return &svs.clients[entnum-1].message;
case MSG_ALL:
int i, large;
ent = G_EDICT(OFS_PARM0);
+ if (ent == sv.edicts)
+ Host_Error("makestatic: can not modify world entity\n");
+ if (ent->e->free)
+ Host_Error("makestatic: can not modify free entity\n");
large = false;
if (ent->v->modelindex >= 256 || ent->v->frame >= 256)
{
edict_t *in, *out;
in = G_EDICT(OFS_PARM0);
+ if (in == sv.edicts)
+ Host_Error("copyentity: can not read world entity\n");
+ if (in->e->free)
+ Host_Error("copyentity: can not read free entity\n");
out = G_EDICT(OFS_PARM1);
+ if (out == sv.edicts)
+ Host_Error("copyentity: can not modify world entity\n");
+ if (out->e->free)
+ Host_Error("copyentity: can not modify free entity\n");
memcpy(out->v, in->v, progs->entityfields * 4);
}
int i, modelindex;
model_t *model;
+ if (e == sv.edicts)
+ Host_Error("setattachment: can not modify world entity\n");
+ if (e->e->free)
+ Host_Error("setattachment: can not modify free entity\n");
+
if (tagentity == NULL)
tagentity = sv.edicts;