+//#502 void(float effectnum, entity own, vector origin_from, vector origin_to, vector dir_from, vector dir_to, float count, float extflags) boxparticles (DP_CSQC_BOXPARTICLES)
+static void VM_CL_boxparticles (void)
+{
+ int effectnum;
+ // prvm_edict_t *own;
+ float *origin_from, *origin_to, *dir_from, *dir_to;
+ float count;
+ int flags;
+ float tintmins[4], tintmaxs[4];
+ prvm_eval_t *val;
+ VM_SAFEPARMCOUNTRANGE(7, 8, VM_CL_boxparticles);
+
+ effectnum = (int)PRVM_G_FLOAT(OFS_PARM0);
+ // own = PRVM_G_EDICT(OFS_PARM1); // TODO find use for this
+ origin_from = PRVM_G_VECTOR(OFS_PARM2);
+ origin_to = PRVM_G_VECTOR(OFS_PARM3);
+ dir_from = PRVM_G_VECTOR(OFS_PARM4);
+ dir_to = PRVM_G_VECTOR(OFS_PARM5);
+ count = PRVM_G_FLOAT(OFS_PARM6);
+ if(prog->argc >= 8)
+ flags = PRVM_G_FLOAT(OFS_PARM7);
+ else
+ flags = 0;
+ Vector4Set(tintmins, 1, 1, 1, 1);
+ Vector4Set(tintmaxs, 1, 1, 1, 1);
+ if(flags & 1) // read alpha
+ {
+ if((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.particles_alphamin)))
+ tintmins[3] = val->_float;
+ if((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.particles_alphamax)))
+ tintmaxs[3] = val->_float;
+ }
+ if(flags & 2) // read color
+ {
+ if((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.particles_colormin)))
+ VectorCopy(val->vector, tintmins);
+ if((val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.particles_colormax)))
+ VectorCopy(val->vector, tintmaxs);
+ }
+ if (effectnum < 0)
+ return;
+ CL_ParticleTrail(effectnum, count, origin_from, origin_to, dir_from, dir_to, NULL, 0, true, true, tintmins, tintmaxs);
+}
+