Permalink
Browse files

Avoid divide by zero in rampslide spark code

  • Loading branch information...
squeek502 committed Dec 8, 2014
1 parent 7c78f2e commit bd06ea147212fb6f0ed0e0bbca7e075195e54aaa
Showing with 1 addition and 1 deletion.
  1. +1 −1 cl_dll/ff/c_ff_player.cpp
@@ -2457,7 +2457,7 @@ void C_FFPlayer::ClientThink( void )
// Hopefully when the particles die the ::Create()
// stuff gets removed automagically?
if (IsRampsliding())
if (IsRampsliding() && GetAbsVelocity().LengthSqr() > 0)
{
Vector vecDir = -GetAbsVelocity() / (GetAbsVelocity().LengthSqr() / 1000.0f);
g_pEffects->Sparks(GetFeetOrigin() + Vector(random->RandomFloat(-8, 8), random->RandomFloat(-8, 8), 0), 1, 1, &vecDir);

0 comments on commit bd06ea1

Please sign in to comment.