+ 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);
+ }