+ if (e->render.effects & EF_FLAME)
+ CL_ParticleTrail(EFFECT_EF_FLAME, 0, origin, origin, vec3_origin, vec3_origin, NULL, 0, true, false);
+ if (e->render.effects & EF_STARDUST)
+ CL_ParticleTrail(EFFECT_EF_STARDUST, 0, origin, origin, vec3_origin, vec3_origin, NULL, 0, true, false);
+ }
+ // muzzleflash fades over time, and is offset a bit
+ if (e->persistent.muzzleflash > 0 && r_refdef.numlights < MAX_DLIGHTS)
+ {
+ vec3_t v2;
+ vec3_t color;
+ trace_t trace;
+ matrix4x4_t tempmatrix;
+ Matrix4x4_Transform(&e->render.matrix, muzzleflashorigin, v2);
+ trace = CL_Move(origin, vec3_origin, vec3_origin, v2, MOVE_NOMONSTERS, NULL, SUPERCONTENTS_SOLID | SUPERCONTENTS_SKY, true, false, NULL, false);
+ Matrix4x4_Normalize(&tempmatrix, &e->render.matrix);
+ Matrix4x4_SetOrigin(&tempmatrix, trace.endpos[0], trace.endpos[1], trace.endpos[2]);
+ Matrix4x4_Scale(&tempmatrix, 150, 1);
+ VectorSet(color, e->persistent.muzzleflash * 4.0f, e->persistent.muzzleflash * 4.0f, e->persistent.muzzleflash * 4.0f);
+ R_RTLight_Update(&r_refdef.lights[r_refdef.numlights++], false, &tempmatrix, color, -1, NULL, true, 0, 0.25, 0, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
+ }
+ // LordHavoc: if the model has no flags, don't check each
+ if (e->render.model && e->render.model->flags && (!e->state_current.tagentity && !(e->render.flags & RENDER_VIEWMODEL)))
+ {
+ if (e->render.model->flags & EF_GIB)
+ trailtype = EFFECT_TR_BLOOD;
+ else if (e->render.model->flags & EF_ZOMGIB)
+ trailtype = EFFECT_TR_SLIGHTBLOOD;
+ else if (e->render.model->flags & EF_TRACER)
+ trailtype = EFFECT_TR_WIZSPIKE;
+ else if (e->render.model->flags & EF_TRACER2)
+ trailtype = EFFECT_TR_KNIGHTSPIKE;
+ else if (e->render.model->flags & EF_ROCKET)
+ trailtype = EFFECT_TR_ROCKET;
+ else if (e->render.model->flags & EF_GRENADE)