fixed: bouncing on actors neither checked nor changed mo->bouncecount.

SVN r3506 (trunk)
This commit is contained in:
Christoph Oelckers 2012-04-01 11:02:05 +00:00
parent 64f14f8d18
commit 92a8f8518c

View file

@ -2846,18 +2846,21 @@ bool P_BounceActor (AActor *mo, AActor * BlockingMobj)
)) ))
{ {
fixed_t speed; fixed_t speed;
angle_t angle = R_PointToAngle2 (BlockingMobj->x, if (mo->bouncecount > 0 && --mo->bouncecount > 0)
BlockingMobj->y, mo->x, mo->y) + ANGLE_1*((pr_bounce()%16)-8); {
speed = P_AproxDistance (mo->velx, mo->vely); angle_t angle = R_PointToAngle2 (BlockingMobj->x,
speed = FixedMul (speed, mo->wallbouncefactor); // [GZ] was 0.75, using wallbouncefactor seems more consistent BlockingMobj->y, mo->x, mo->y) + ANGLE_1*((pr_bounce()%16)-8);
mo->angle = angle; speed = P_AproxDistance (mo->velx, mo->vely);
angle >>= ANGLETOFINESHIFT; speed = FixedMul (speed, mo->wallbouncefactor); // [GZ] was 0.75, using wallbouncefactor seems more consistent
mo->velx = FixedMul (speed, finecosine[angle]); mo->angle = angle;
mo->vely = FixedMul (speed, finesine[angle]); angle >>= ANGLETOFINESHIFT;
mo->PlayBounceSound(true); mo->velx = FixedMul (speed, finecosine[angle]);
return true; mo->vely = FixedMul (speed, finesine[angle]);
mo->PlayBounceSound(true);
return true;
}
} }
else return false; return false;
} }
//============================================================================ //============================================================================