+ part->airfriction = pairfriction;
+ part->liquidfriction = pliquidfriction;
+ part->die = cl.time + part->alpha / (part->alphafade ? part->alphafade : 1);
+ part->delayedcollisions = 0;
+ // if it is rain or snow, trace ahead and shut off collisions until an actual collision event needs to occur to improve performance
+ if (part->type == particletype + pt_rain)
+ {
+ int i;
+ particle_t *part2;
+ float lifetime = part->die - cl.time;
+ vec3_t endvec;
+ trace_t trace;
+ // turn raindrop into simple spark and create delayedspawn splash effect
+ part->type = particletype + pt_spark;
+ part->bounce = 0;
+ VectorMA(part->org, lifetime, part->vel, endvec);
+ trace = CL_Move(part->org, vec3_origin, vec3_origin, endvec, MOVE_NOMONSTERS, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | ((part->type == particletype + pt_rain || part->type == particletype + pt_snow) ? SUPERCONTENTS_LIQUIDSMASK : 0), true, false, NULL, false);
+ part->die = cl.time + lifetime * trace.fraction;
+ part2 = particle(particletype + pt_raindecal, pcolor1, pcolor2, tex_rainsplash, part->size, part->size * 20, part->alpha, part->alpha / 0.4, 0, 0, trace.endpos[0] + trace.plane.normal[0], trace.endpos[1] + trace.plane.normal[1], trace.endpos[2] + trace.plane.normal[2], trace.plane.normal[0], trace.plane.normal[1], trace.plane.normal[2], 0, 0, 0, 0);
+ if (part2)
+ {
+ part2->delayedspawn = part->die;
+ part2->die += part->die - cl.time;
+ for (i = rand() & 7;i < 10;i++)
+ {
+ part2 = particle(particletype + pt_spark, pcolor1, pcolor2, tex_particle, 0.25f, 0, part->alpha * 2, part->alpha * 4, 1, 0, trace.endpos[0] + trace.plane.normal[0], trace.endpos[1] + trace.plane.normal[1], trace.endpos[2] + trace.plane.normal[2], trace.plane.normal[0] * 16, trace.plane.normal[1] * 16, trace.plane.normal[2] * 16 + cl.movevars_gravity * 0.04, 0, 0, 0, 32);
+ if (part2)
+ {
+ part2->delayedspawn = part->die;
+ part2->die += part->die - cl.time;
+ }
+ }
+ }
+ }
+ else if (part->bounce != 0 && part->gravity == 0)
+ {
+ float lifetime = part->alpha / (part->alphafade ? part->alphafade : 1);
+ vec3_t endvec;
+ trace_t trace;
+ VectorMA(part->org, lifetime, part->vel, endvec);
+ trace = CL_Move(part->org, vec3_origin, vec3_origin, endvec, MOVE_NOMONSTERS, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_BODY | ((part->type == particletype + pt_rain || part->type == particletype + pt_snow) ? SUPERCONTENTS_LIQUIDSMASK : 0), true, false, NULL, false);
+ part->delayedcollisions = cl.time + lifetime * trace.fraction;
+ }