]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
don't try to send a svc_pointparticles or svc_trailparticles message if
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 18 May 2008 09:28:11 +0000 (09:28 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 18 May 2008 09:28:11 +0000 (09:28 +0000)
the effectnum is negative (such as the -1 returned by particleeffectnum
when it fails to find a match)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8301 d7cf8633-e32d-0410-b094-e92efae38249

clvm_cmds.c
svvm_cmds.c

index d00769327d90346fc0df844f5f83ed09ebc920c8..a5ae8f06fb3c122e5716d655400f205d20772209 100644 (file)
@@ -1076,6 +1076,8 @@ static void VM_CL_trailparticles (void)
        start   = PRVM_G_VECTOR(OFS_PARM2);
        end             = PRVM_G_VECTOR(OFS_PARM3);
 
+       if (i < 0)
+               return;
        CL_ParticleEffect(i, VectorDistance(start, end), start, end, t->fields.client->velocity, t->fields.client->velocity, NULL, prog->argc >= 5 ? (int)PRVM_G_FLOAT(OFS_PARM4) : 0);
 }
 
@@ -1089,6 +1091,8 @@ static void VM_CL_pointparticles (void)
        f = PRVM_G_VECTOR(OFS_PARM1);
        v = PRVM_G_VECTOR(OFS_PARM2);
        n = (int)PRVM_G_FLOAT(OFS_PARM3);
+       if (i < 0)
+               return;
        CL_ParticleEffect(i, n, f, f, v, v, NULL, prog->argc >= 5 ? (int)PRVM_G_FLOAT(OFS_PARM4) : 0);
 }
 
index 28108f8843674b83c5aaffaa881ab4f4ed3f09c5..6bbd066da6d2a451cccca4e6213fe9d205111ff3 100644 (file)
@@ -2809,6 +2809,9 @@ static void VM_SV_trailparticles (void)
 {
        VM_SAFEPARMCOUNT(4, VM_SV_trailparticles);
 
+       if ((int)PRVM_G_FLOAT(OFS_PARM0) < 0)
+               return;
+
        MSG_WriteByte(&sv.datagram, svc_trailparticles);
        MSG_WriteShort(&sv.datagram, PRVM_G_EDICTNUM(OFS_PARM0));
        MSG_WriteShort(&sv.datagram, (int)PRVM_G_FLOAT(OFS_PARM1));
@@ -2823,6 +2826,10 @@ static void VM_SV_pointparticles (void)
        int effectnum, count;
        vec3_t org, vel;
        VM_SAFEPARMCOUNTRANGE(4, 8, VM_SV_pointparticles);
+
+       if ((int)PRVM_G_FLOAT(OFS_PARM0) < 0)
+               return;
+
        effectnum = (int)PRVM_G_FLOAT(OFS_PARM0);
        VectorCopy(PRVM_G_VECTOR(OFS_PARM1), org);
        VectorCopy(PRVM_G_VECTOR(OFS_PARM2), vel);