+
+ // heavily optimized decal case
+ if (p->type == decaltype)
+ {
+ // FIXME: this has fairly wacky handling of alpha
+ if (cl.time > p->time2 + cl_decals_time.value)
+ {
+ p->alpha -= decalfade;
+ if (p->alpha <= 0)
+ {
+ p->type = NULL;
+ if (cl.free_particle > i)
+ cl.free_particle = i;
+ continue;
+ }
+ }
+ if (p->owner)
+ {
+ if (cl.entities[p->owner].render.model == p->ownermodel)
+ {
+ Matrix4x4_Transform(&cl.entities[p->owner].render.matrix, p->relativeorigin, p->org);
+ Matrix4x4_Transform3x3(&cl.entities[p->owner].render.matrix, p->relativedirection, p->vel);
+ }
+ else
+ {
+ p->type = NULL;
+ if (cl.free_particle > i)
+ cl.free_particle = i;
+ }
+ }
+ continue;
+ }
+