"DP_SV_NODRAWTOCLIENT "
"DP_SV_PING "
"DP_SV_PLAYERPHYSICS "
+"DP_SV_POINTPARTICLES "
"DP_SV_PRECACHEANYTIME "
"DP_SV_PRINT "
"DP_SV_PUNCHVECTOR "
//#337 void(float effectnum, vector origin, vector dir, float count) pointparticles (EXT_CSQC)
static void VM_SV_pointparticles (void)
{
- VM_SAFEPARMCOUNT(4, VM_SV_pointparticles);
+ int effectnum, count;
+ vec3_t org, vel;
+ VM_SAFEPARMCOUNTRANGE(4, 8, VM_SV_pointparticles);
+ effectnum = (int)PRVM_G_FLOAT(OFS_PARM0);
+ VectorCopy(PRVM_G_VECTOR(OFS_PARM1), org);
+ VectorCopy(PRVM_G_VECTOR(OFS_PARM2), vel);
+ count = bound(0, (int)PRVM_G_FLOAT(OFS_PARM3), 65535);
+ if (count == 1 && !VectorLength2(vel))
+ {
+ // 1+2+12=15 bytes
+ MSG_WriteByte(&sv.datagram, svc_pointparticles1);
+ MSG_WriteShort(&sv.datagram, effectnum);
+ MSG_WriteVector(&sv.datagram, org, sv.protocol);
+ }
+ else
+ {
+ // 1+2+12+12+2=29 bytes
+ MSG_WriteByte(&sv.datagram, svc_pointparticles);
+ MSG_WriteShort(&sv.datagram, effectnum);
+ MSG_WriteVector(&sv.datagram, org, sv.protocol);
+ MSG_WriteVector(&sv.datagram, vel, sv.protocol);
+ MSG_WriteShort(&sv.datagram, count);
+ }
- MSG_WriteByte(&sv.datagram, svc_pointparticles);
- MSG_WriteShort(&sv.datagram, (int)PRVM_G_FLOAT(OFS_PARM0));
- MSG_WriteVector(&sv.datagram, PRVM_G_VECTOR(OFS_PARM1), sv.protocol);
- MSG_WriteVector(&sv.datagram, PRVM_G_VECTOR(OFS_PARM2), sv.protocol);
- MSG_WriteShort(&sv.datagram, bound(0, (int)PRVM_G_FLOAT(OFS_PARM3), 65535));
SV_FlushBroadcastMessages();
}