- fixed: The bounce on actors check handled infinite bouncers (bouncecount == 0) incorrectly.

SVN r3521 (trunk)
This commit is contained in:
Christoph Oelckers 2012-04-07 08:21:44 +00:00
parent f6817f9544
commit 35f0b32a7f

View file

@ -2845,20 +2845,19 @@ bool P_BounceActor (AActor *mo, AActor * BlockingMobj)
|| ((BlockingMobj->player == NULL) && (!(BlockingMobj->flags3 & MF3_ISMONSTER))) || ((BlockingMobj->player == NULL) && (!(BlockingMobj->flags3 & MF3_ISMONSTER)))
)) ))
{ {
if (mo->bouncecount > 0 && --mo->bouncecount == 0) return false;
fixed_t speed; 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);
angle_t angle = R_PointToAngle2 (BlockingMobj->x, speed = P_AproxDistance (mo->velx, mo->vely);
BlockingMobj->y, mo->x, mo->y) + ANGLE_1*((pr_bounce()%16)-8); speed = FixedMul (speed, mo->wallbouncefactor); // [GZ] was 0.75, using wallbouncefactor seems more consistent
speed = P_AproxDistance (mo->velx, mo->vely); mo->angle = angle;
speed = FixedMul (speed, mo->wallbouncefactor); // [GZ] was 0.75, using wallbouncefactor seems more consistent angle >>= ANGLETOFINESHIFT;
mo->angle = angle; mo->velx = FixedMul (speed, finecosine[angle]);
angle >>= ANGLETOFINESHIFT; mo->vely = FixedMul (speed, finesine[angle]);
mo->velx = FixedMul (speed, finecosine[angle]); mo->PlayBounceSound(true);
mo->vely = FixedMul (speed, finesine[angle]); return true;
mo->PlayBounceSound(true);
return true;
}
} }
return false; return false;
} }