{
char *s;
int i;
-
+
if (sv.state != ss_loading)
PR_RunError ("PF_Precache_*: Precache can only be done in spawn functions");
edict_t *ent;
vec3_t end;
trace_t trace;
-
+
ent = PROG_TO_EDICT(pr_global_struct->self);
VectorCopy (ent->v.origin, end);
end[2] -= 256;
-
+
trace = SV_Move (ent->v.origin, ent->v.mins, ent->v.maxs, end, MOVE_NORMAL, ent);
if (trace.fraction == 1 || trace.allsolid)
ent->v.flags = (int)ent->v.flags | FL_ONGROUND;
ent->v.groundentity = EDICT_TO_PROG(trace.ent);
G_FLOAT(OFS_RETURN) = 1;
+ // if support is destroyed, keep suspended (gross hack for floating items in various maps)
+ ent->suspendedinairflag = true;
}
}
char *val;
client_t *client;
int j;
-
+
style = G_FLOAT(OFS_PARM0);
val = G_STRING(OFS_PARM1);
// change the string in sv
sv.lightstyles[style] = val;
-
+
// send message to all clients on this server
if (sv.state != ss_active)
return;
-
+
for (j=0, client = svs.clients ; j<svs.maxclients ; j++, client++)
if (client->active || client->spawned)
{
{
int i;
edict_t *ent;
-
+
i = G_EDICTNUM(OFS_PARM0);
while (1)
{
trace_t tr;
float dist, bestdist;
float speed;
-
+
ent = G_EDICT(OFS_PARM0);
speed = G_FLOAT(OFS_PARM1);
VectorCopy (dir, bestdir);
bestdist = sv_aim.value;
bestent = NULL;
-
+
check = NEXT_EDICT(sv.edicts);
for (i=1 ; i<sv.num_edicts ; i++, check = NEXT_EDICT(check) )
{
bestent = check;
}
}
-
+
if (bestent)
{
VectorSubtract (bestent->v.origin, ent->v.origin, dir);
VectorScale (pr_global_struct->v_forward, dist, end);
end[2] = dir[2];
VectorNormalize (end);
- VectorCopy (end, G_VECTOR(OFS_RETURN));
+ VectorCopy (end, G_VECTOR(OFS_RETURN));
}
else
{
{
edict_t *ent;
float ideal, current, move, speed;
-
+
ent = PROG_TO_EDICT(pr_global_struct->self);
current = ANGLEMOD(ent->v.angles[1]);
ideal = ent->v.ideal_yaw;
speed = ent->v.yaw_speed;
-
+
if (current == ideal)
return;
move = ideal - current;
if (move < -speed)
move = -speed;
}
-
+
ent->v.angles[1] = ANGLEMOD (current + move);
}
edict_t *ent;
float ideal, current, move, speed;
eval_t *val;
-
+
ent = G_EDICT(OFS_PARM0);
current = ANGLEMOD( ent->v.angles[0] );
if ((val = GETEDICTFIELDVALUE(ent, eval_idealpitch)))
PR_RunError ("PF_changepitch: .float idealpitch and .float pitch_speed must be defined to use changepitch");
return;
}
-
+
if (current == ideal)
return;
move = ideal - current;
if (move < -speed)
move = -speed;
}
-
+
ent->v.angles[0] = ANGLEMOD (current + move);
}
{
case MSG_BROADCAST:
return &sv.datagram;
-
+
case MSG_ONE:
ent = PROG_TO_EDICT(pr_global_struct->msg_entity);
entnum = NUM_FOR_EDICT(ent);
if (entnum < 1 || entnum > svs.maxclients)
PR_RunError ("WriteDest: not a client");
return &svs.clients[entnum-1].message;
-
+
case MSG_ALL:
return &sv.reliable_datagram;
-
+
case MSG_INIT:
return &sv.signon;
PR_RunError ("WriteDest: bad destination");
break;
}
-
+
return NULL;
}
{
edict_t *ent;
int i, large;
-
+
ent = G_EDICT(OFS_PARM0);
large = false;
if (svs.changelevel_issued)
return;
svs.changelevel_issued = true;
-
+
s = G_STRING(OFS_PARM0);
Cbuf_AddText (va("changelevel %s\n",s));
}
temp[2] = (rand()&32767) * (2.0 / 32767.0) - 1.0;
}
while (DotProduct(temp, temp) >= 1);
- VectorCopy (temp, G_VECTOR(OFS_RETURN));
+ VectorCopy (temp, G_VECTOR(OFS_RETURN));
}
void SV_LightPoint (vec3_t color, vec3_t p);
vec_t* p;
p = G_VECTOR(OFS_PARM0);
SV_LightPoint (color, p);
- VectorCopy (color, G_VECTOR(OFS_RETURN));
+ VectorCopy (color, G_VECTOR(OFS_RETURN));
}
#define MAX_QC_CVARS 128
// first check to see if it has already been defined
if (Cvar_FindVar (name))
return;
-
+
// check for overlap with a command
if (Cmd_Exists (name))
{
// copy the name and value
variable = &qc_cvar[currentqc_cvar++];
- variable->name = Z_Malloc (strlen(name)+1);
+ variable->name = Z_Malloc (strlen(name)+1);
strcpy (variable->name, name);
- variable->string = Z_Malloc (strlen(value)+1);
+ variable->string = Z_Malloc (strlen(value)+1);
strcpy (variable->string, value);
variable->value = atof (value);
-
+
// link the variable in
variable->next = cvar_vars;
cvar_vars = variable;