CL_ParticleEffect(effectindex, count, origin, origin, velocity, velocity, NULL, 0);
}
+void CL_ParsePointParticles1(void)
+{
+ int effectindex;
+ vec3_t origin;
+ effectindex = (unsigned short)MSG_ReadShort();
+ MSG_ReadVector(origin, cls.protocol);
+ CL_ParticleEffect(effectindex, 1, origin, origin, vec3_origin, vec3_origin, NULL, 0);
+}
+
typedef struct cl_iplog_item_s
{
char *address;
case svc_pointparticles:
CL_ParsePointParticles();
break;
+ case svc_pointparticles1:
+ CL_ParsePointParticles1();
+ break;
}
}
}
#define svc_csqcentities 58 // [short] entnum [variable length] entitydata ... [short] 0x0000
#define svc_spawnstaticsound2 59 // [coord3] [short] samp [byte] vol [byte] aten
#define svc_trailparticles 60 // [short] entnum [short] effectnum [vector] start [vector] end
-#define svc_pointparticles 61 // [short] effectnum [vector] start [vector] end [short] count
+#define svc_pointparticles 61 // [short] effectnum [vector] start [vector] velocity [short] count
+#define svc_pointparticles1 62 // [short] effectnum [vector] start, same as svc_pointparticles except velocity is zero and count is 1 (PROTOCOL_DARKPLACES8)
//
// client to server
//#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) && (sv.protocol != PROTOCOL_QUAKE && sv.protocol != PROTOCOL_QUAKEDP && sv.protocol != PROTOCOL_NEHAHRAMOVIE && sv.protocol != PROTOCOL_DARKPLACES1 && sv.protocol != DARKPLACES2 && sv.protocol != DARKPLACES3 && sv.protocol != DARKPLACES4 && sv.protocol != DARKPLACES5 && sv.protocol != DARKPLACES6 && sv.protocol != DARKPLACES7))
+ {
+ // 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();
}