From 8a2271218007e4af1a26c984fc7c7a142672f395 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 30 Jan 2010 14:49:15 +0000 Subject: [PATCH] - fixed: Rocket trail particle positioning only worked when the rocket was moving. SVN r2145 (trunk) --- src/p_effect.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/p_effect.cpp b/src/p_effect.cpp index 8a4d5bb1f..0ecb53798 100644 --- a/src/p_effect.cpp +++ b/src/p_effect.cpp @@ -235,7 +235,18 @@ static void MakeFountain (AActor *actor, int color1, int color2) void P_RunEffect (AActor *actor, int effects) { - angle_t moveangle = R_PointToAngle2(0,0,actor->velx,actor->vely); + angle_t moveangle; + + // 512 is the limit below which R_PointToAngle2 does no longer returns usable values. + if (abs(actor->velx) > 512 || abs(actor->vely) > 512) + { + moveangle = R_PointToAngle2(0,0,actor->velx,actor->vely); + } + else + { + moveangle = actor->angle; + } + particle_t *particle; int i;