From 35f0b32a7ffe83aa2890a368fe8b67dadda058f4 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 7 Apr 2012 08:21:44 +0000 Subject: [PATCH] - fixed: The bounce on actors check handled infinite bouncers (bouncecount == 0) incorrectly. SVN r3521 (trunk) --- src/p_map.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/p_map.cpp b/src/p_map.cpp index 9a1526c43..a178b5aab 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -2845,20 +2845,19 @@ bool P_BounceActor (AActor *mo, AActor * BlockingMobj) || ((BlockingMobj->player == NULL) && (!(BlockingMobj->flags3 & MF3_ISMONSTER))) )) { + if (mo->bouncecount > 0 && --mo->bouncecount == 0) return false; + fixed_t speed; - 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; - } + 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; } return false; }