From 92a8f8518c0017d25a18e58f2a675a17262430db Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 1 Apr 2012 11:02:05 +0000 Subject: [PATCH] fixed: bouncing on actors neither checked nor changed mo->bouncecount. SVN r3506 (trunk) --- src/p_map.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/p_map.cpp b/src/p_map.cpp index b5622092a..d0d270679 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -2846,18 +2846,21 @@ bool P_BounceActor (AActor *mo, AActor * BlockingMobj) )) { fixed_t speed; - angle_t angle = R_PointToAngle2 (BlockingMobj->x, - BlockingMobj->y, mo->x, mo->y) + ANGLE_1*((pr_bounce()%16)-8); - speed = P_AproxDistance (mo->velx, mo->vely); - speed = FixedMul (speed, mo->wallbouncefactor); // [GZ] was 0.75, using wallbouncefactor seems more consistent - mo->angle = angle; - angle >>= ANGLETOFINESHIFT; - mo->velx = FixedMul (speed, finecosine[angle]); - mo->vely = FixedMul (speed, finesine[angle]); - mo->PlayBounceSound(true); - return true; + if (mo->bouncecount > 0 && --mo->bouncecount > 0) + { + angle_t angle = R_PointToAngle2 (BlockingMobj->x, + BlockingMobj->y, mo->x, mo->y) + ANGLE_1*((pr_bounce()%16)-8); + speed = P_AproxDistance (mo->velx, mo->vely); + speed = FixedMul (speed, mo->wallbouncefactor); // [GZ] was 0.75, using wallbouncefactor seems more consistent + mo->angle = angle; + angle >>= ANGLETOFINESHIFT; + mo->velx = FixedMul (speed, finecosine[angle]); + mo->vely = FixedMul (speed, finesine[angle]); + mo->PlayBounceSound(true); + return true; + } } - else return false; + return false; } //============================================================================