"DP_EF_BLUE "
"DP_EF_FLAME "
"DP_EF_FULLBRIGHT "
+"DP_EF_NODEPTHTEST "
"DP_EF_NODRAW "
"DP_EF_NOSHADOW "
"DP_EF_RED "
"KRIMZON_SV_PARSECLIENTCOMMAND "
"NEH_CMD_PLAY2 "
"NEH_RESTOREGAME "
+"NXQ_GFX_LETTERBOX "
"TENEBRAE_GFX_DLIGHTS "
"TW_SV_STEPCONTROL "
;
yaw = 0;
else
{
- yaw = (int) (atan2(value1[1], value1[0]) * 180 / M_PI);
+ yaw = (atan2(value1[1], value1[0]) * 180 / M_PI);
if (yaw < 0)
yaw += 360;
}
*/
void PF_vectoangles (void)
{
- float *value1;
- float forward;
- float yaw, pitch;
+ double value1[3], forward, yaw, pitch;
- value1 = G_VECTOR(OFS_PARM0);
+ VectorCopy(G_VECTOR(OFS_PARM0), value1);
if (value1[1] == 0 && value1[0] == 0)
{
yaw = 270;
forward = sqrt(value1[0]*value1[0] + value1[1]*value1[1]);
- pitch = (int) (atan2(value1[2], forward) * 180 / M_PI);
+ pitch = (atan2(value1[2], forward) * 180 / M_PI);
if (pitch < 0)
pitch += 360;
}
- G_FLOAT(OFS_RETURN+0) = pitch;
- G_FLOAT(OFS_RETURN+1) = yaw;
- G_FLOAT(OFS_RETURN+2) = 0;
+ VectorSet(G_VECTOR(OFS_RETURN), pitch, yaw, 0);
}
/*
char *samp;
float *pos;
float vol, attenuation;
- int i, soundnum, large;
+ int soundnum, large;
pos = G_VECTOR (OFS_PARM0);
samp = G_STRING(OFS_PARM1);
else
MSG_WriteByte (&sv.signon, svc_spawnstaticsound);
- for (i=0 ; i<3 ; i++)
- MSG_WriteDPCoord(&sv.signon, pos[i]);
+ MSG_WriteVector(&sv.signon, pos, sv.protocol);
if (large)
MSG_WriteShort (&sv.signon, soundnum);
{
char *s;
int i;
+ int limit = (sv.protocol == PROTOCOL_QUAKE ? 256 : MAX_SOUNDS);
if (sv.state != ss_loading)
PF_ERROR("PF_Precache_*: Precache can only be done in spawn functions");
G_INT(OFS_RETURN) = G_INT(OFS_PARM0);
PR_CheckEmptyString (s);
- for (i=0 ; i<MAX_SOUNDS ; i++)
+ for (i=0 ; i<limit ; i++)
{
if (!sv.sound_precache[i])
{
{
char *s;
int i;
+ int limit = (sv.protocol == PROTOCOL_QUAKE ? 256 : MAX_MODELS);
if (sv.state != ss_loading)
PF_ERROR("PF_Precache_*: Precache can only be done in spawn functions");
G_INT(OFS_RETURN) = G_INT(OFS_PARM0);
PR_CheckEmptyString (s);
- for (i=0 ; i<MAX_MODELS ; i++)
+ for (i = 0;i < limit;i++)
{
if (!sv.model_precache[i])
{
void PF_WriteAngle (void)
{
- MSG_WriteAngle (WriteDest(), G_FLOAT(OFS_PARM1));
+ MSG_WriteAngle (WriteDest(), G_FLOAT(OFS_PARM1), sv.protocol);
}
void PF_WriteCoord (void)
{
- MSG_WriteDPCoord (WriteDest(), G_FLOAT(OFS_PARM1));
+ MSG_WriteCoord (WriteDest(), G_FLOAT(OFS_PARM1), sv.protocol);
}
void PF_WriteString (void)
MSG_WriteByte (&sv.signon, ent->v->skin);
for (i=0 ; i<3 ; i++)
{
- MSG_WriteDPCoord(&sv.signon, ent->v->origin[i]);
- MSG_WriteAngle(&sv.signon, ent->v->angles[i]);
+ MSG_WriteCoord(&sv.signon, ent->v->origin[i], sv.protocol);
+ MSG_WriteAngle(&sv.signon, ent->v->angles[i], sv.protocol);
}
// throw the entity away now
VectorMA(ambientcolor, 0.5, diffusecolor, G_VECTOR(OFS_RETURN));
}
-#define MAX_QC_CVARS 128
-cvar_t qc_cvar[MAX_QC_CVARS];
-int currentqc_cvar;
-
void PF_registercvar (void)
{
char *name, *value;
- cvar_t *variable;
name = G_STRING(OFS_PARM0);
value = G_STRING(OFS_PARM1);
G_FLOAT(OFS_RETURN) = 0;
+
// first check to see if it has already been defined
if (Cvar_FindVar (name))
return;
return;
}
- if (currentqc_cvar >= MAX_QC_CVARS)
- PF_ERROR("PF_registercvar: ran out of cvar slots\n");
-
-// copy the name and value
- variable = &qc_cvar[currentqc_cvar++];
- variable->name = Z_Malloc (strlen(name)+1);
- strcpy (variable->name, name);
- variable->string = Z_Malloc (strlen(value)+1);
- strcpy (variable->string, value);
- variable->value = atof (value);
+ Cvar_Get(name, value, 0);
- Cvar_RegisterVariable(variable);
G_FLOAT(OFS_RETURN) = 1; // success
}
*/
void PF_effect (void)
{
+ int i;
char *s;
s = G_STRING(OFS_PARM1);
if (!s || !s[0])
PF_WARNING("effect: no model specified\n");
- SV_StartEffect(G_VECTOR(OFS_PARM0), SV_ModelIndex(s), G_FLOAT(OFS_PARM2), G_FLOAT(OFS_PARM3), G_FLOAT(OFS_PARM4));
+ i = SV_ModelIndex(s);
+ if (i < 0)
+ PF_WARNING("effect: model not precached\n");
+ SV_StartEffect(G_VECTOR(OFS_PARM0), i, G_FLOAT(OFS_PARM2), G_FLOAT(OFS_PARM3), G_FLOAT(OFS_PARM4));
}
void PF_te_blood (void)
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_BLOOD);
// origin
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
// velocity
MSG_WriteByte(&sv.datagram, bound(-128, (int) G_VECTOR(OFS_PARM1)[0], 127));
MSG_WriteByte(&sv.datagram, bound(-128, (int) G_VECTOR(OFS_PARM1)[1], 127));
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_BLOODSHOWER);
// min
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
// max
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[2], sv.protocol);
// speed
- MSG_WriteDPCoord(&sv.datagram, G_FLOAT(OFS_PARM2));
+ MSG_WriteCoord(&sv.datagram, G_FLOAT(OFS_PARM2), sv.protocol);
// count
MSG_WriteShort(&sv.datagram, bound(0, G_FLOAT(OFS_PARM3), 65535));
}
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_EXPLOSIONRGB);
// origin
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
// color
MSG_WriteByte(&sv.datagram, bound(0, (int) (G_VECTOR(OFS_PARM1)[0] * 255), 255));
MSG_WriteByte(&sv.datagram, bound(0, (int) (G_VECTOR(OFS_PARM1)[1] * 255), 255));
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_PARTICLECUBE);
// min
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
// max
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[2], sv.protocol);
// velocity
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[2], sv.protocol);
// count
MSG_WriteShort(&sv.datagram, bound(0, G_FLOAT(OFS_PARM3), 65535));
// color
// gravity true/false
MSG_WriteByte(&sv.datagram, ((int) G_FLOAT(OFS_PARM5)) != 0);
// randomvel
- MSG_WriteDPCoord(&sv.datagram, G_FLOAT(OFS_PARM6));
+ MSG_WriteCoord(&sv.datagram, G_FLOAT(OFS_PARM6), sv.protocol);
}
void PF_te_particlerain (void)
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_PARTICLERAIN);
// min
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
// max
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[2], sv.protocol);
// velocity
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[2], sv.protocol);
// count
MSG_WriteShort(&sv.datagram, bound(0, G_FLOAT(OFS_PARM3), 65535));
// color
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_PARTICLESNOW);
// min
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
// max
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[2], sv.protocol);
// velocity
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[2], sv.protocol);
// count
MSG_WriteShort(&sv.datagram, bound(0, G_FLOAT(OFS_PARM3), 65535));
// color
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_SPARK);
// origin
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
// velocity
MSG_WriteByte(&sv.datagram, bound(-128, (int) G_VECTOR(OFS_PARM1)[0], 127));
MSG_WriteByte(&sv.datagram, bound(-128, (int) G_VECTOR(OFS_PARM1)[1], 127));
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_GUNSHOTQUAD);
// origin
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
}
void PF_te_spikequad (void)
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_SPIKEQUAD);
// origin
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
}
void PF_te_superspikequad (void)
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_SUPERSPIKEQUAD);
// origin
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
}
void PF_te_explosionquad (void)
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_EXPLOSIONQUAD);
// origin
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
}
void PF_te_smallflash (void)
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_SMALLFLASH);
// origin
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
}
void PF_te_customflash (void)
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_CUSTOMFLASH);
// origin
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
// radius
MSG_WriteByte(&sv.datagram, bound(0, G_FLOAT(OFS_PARM1) / 8 - 1, 255));
// lifetime
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_GUNSHOT);
// origin
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
}
void PF_te_spike (void)
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_SPIKE);
// origin
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
}
void PF_te_superspike (void)
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_SUPERSPIKE);
// origin
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
}
void PF_te_explosion (void)
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_EXPLOSION);
// origin
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
}
void PF_te_tarexplosion (void)
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_TAREXPLOSION);
// origin
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
}
void PF_te_wizspike (void)
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_WIZSPIKE);
// origin
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
}
void PF_te_knightspike (void)
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_KNIGHTSPIKE);
// origin
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
}
void PF_te_lavasplash (void)
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_LAVASPLASH);
// origin
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
}
void PF_te_teleport (void)
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_TELEPORT);
// origin
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
}
void PF_te_explosion2 (void)
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_EXPLOSION2);
// origin
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
// color
MSG_WriteByte(&sv.datagram, G_FLOAT(OFS_PARM1));
MSG_WriteByte(&sv.datagram, G_FLOAT(OFS_PARM2));
// owner entity
MSG_WriteShort(&sv.datagram, G_EDICTNUM(OFS_PARM0));
// start
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[2], sv.protocol);
// end
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[2], sv.protocol);
}
void PF_te_lightning2 (void)
// owner entity
MSG_WriteShort(&sv.datagram, G_EDICTNUM(OFS_PARM0));
// start
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[2], sv.protocol);
// end
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[2], sv.protocol);
}
void PF_te_lightning3 (void)
// owner entity
MSG_WriteShort(&sv.datagram, G_EDICTNUM(OFS_PARM0));
// start
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[2], sv.protocol);
// end
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[2], sv.protocol);
}
void PF_te_beam (void)
// owner entity
MSG_WriteShort(&sv.datagram, G_EDICTNUM(OFS_PARM0));
// start
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM1)[2], sv.protocol);
// end
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM2)[2], sv.protocol);
}
void PF_te_plasmaburn (void)
{
MSG_WriteByte(&sv.datagram, svc_temp_entity);
MSG_WriteByte(&sv.datagram, TE_PLASMABURN);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1]);
- MSG_WriteDPCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2]);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[0], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[1], sv.protocol);
+ MSG_WriteCoord(&sv.datagram, G_VECTOR(OFS_PARM0)[2], sv.protocol);
}
static void clippointtosurface(msurface_t *surf, vec3_t p, vec3_t out)
c = FS_Getc(pr_files[filenum]);
if (developer.integer)
Con_Printf("fgets: %s\n", string);
- if (c >= 0)
+ if (c >= 0 || end)
G_INT(OFS_RETURN) = PR_SetString(string);
else
G_INT(OFS_RETURN) = 0;
for (i = 0;i < model->data_overridetagnamesforskin[(unsigned int)tagentity->v->skin].num_overridetagnames;i++)
if (!strcmp(tagname, model->data_overridetagnamesforskin[(unsigned int)tagentity->v->skin].data_overridetagnames[i].name))
v->_float = i + 1;
+ // FIXME: use a model function to get tag info (need to handle skeletal)
if (v->_float == 0 && model->alias.aliasnum_tags)
for (i = 0;i < model->alias.aliasnum_tags;i++)
if (!strcmp(tagname, model->alias.aliasdata_tags[i].name))