X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=cl_particles.c;h=1fd2c3f3fecb5c2e4a6082fa7cff87d2f08c5775;hb=695c0dbca4dd38ec56fb369dc886151de2001d0b;hp=d658b7b6e43bd8e425e25a418016101db6f4b7b2;hpb=16742571f9a7d696a654668febdc10b4f4affd57;p=xonotic%2Fdarkplaces.git diff --git a/cl_particles.c b/cl_particles.c index d658b7b6..1fd2c3f3 100644 --- a/cl_particles.c +++ b/cl_particles.c @@ -849,13 +849,18 @@ void CL_ParticleEffect_Fallback(int effectnameindex, float count, const vec3_t o VectorSubtract(originmaxs, originmins, dir); len = VectorNormalizeLength(dir); - dec = -ent->persistent.trail_time; - ent->persistent.trail_time += len; - if (ent->persistent.trail_time < 0.01f) - return; + if (ent) + { + dec = -ent->persistent.trail_time; + ent->persistent.trail_time += len; + if (ent->persistent.trail_time < 0.01f) + return; - // if we skip out, leave it reset - ent->persistent.trail_time = 0.0f; + // if we skip out, leave it reset + ent->persistent.trail_time = 0.0f; + } + else + dec = 0; // advance into this frame to reach the first puff location VectorMA(originmins, dec, dir, pos); @@ -1008,7 +1013,8 @@ void CL_ParticleEffect_Fallback(int effectnameindex, float count, const vec3_t o len -= dec; VectorMA (pos, dec, dir, pos); } - ent->persistent.trail_time = len; + if (ent) + ent->persistent.trail_time = len; } else if (developer.integer >= 1) Con_Printf("CL_ParticleEffect_Fallback: no fallback found for effect %s\n", particleeffectname[effectnameindex]);