mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-29 07:22:07 +00:00
- fixed a few issues with actor bouncing logic.
This commit is contained in:
parent
5dd00e44ef
commit
1a63450fe2
2 changed files with 7 additions and 4 deletions
|
@ -3532,6 +3532,10 @@ bool P_BounceActor(AActor *mo, AActor *BlockingMobj, bool ontop)
|
|||
|| ((mo->flags6 & MF6_NOBOSSRIP) && (BlockingMobj->flags2 & MF2_BOSS))) && (BlockingMobj->flags2 & MF2_REFLECTIVE))
|
||||
|| ((BlockingMobj->player == NULL) && (!(BlockingMobj->flags3 & MF3_ISMONSTER)))))
|
||||
{
|
||||
// Rippers should not bounce off shootable actors, since they rip through them.
|
||||
if ((mo->flags & MF_MISSILE) && (mo->flags2 & MF2_RIP) && BlockingMobj->flags & MF_SHOOTABLE)
|
||||
return true;
|
||||
|
||||
if (mo->bouncecount>0 && --mo->bouncecount == 0)
|
||||
{
|
||||
if (mo->flags & MF_MISSILE)
|
||||
|
@ -3549,6 +3553,7 @@ bool P_BounceActor(AActor *mo, AActor *BlockingMobj, bool ontop)
|
|||
{
|
||||
DAngle angle = BlockingMobj->AngleTo(mo) + ((pr_bounce() % 16) - 8);
|
||||
double speed = mo->VelXYToSpeed() * mo->wallbouncefactor; // [GZ] was 0.75, using wallbouncefactor seems more consistent
|
||||
if (fabs(speed) < EQUAL_EPSILON) speed = 0;
|
||||
mo->Angles.Yaw = angle;
|
||||
mo->VelFromAngle(speed);
|
||||
mo->PlayBounceSound(true);
|
||||
|
@ -3575,7 +3580,7 @@ bool P_BounceActor(AActor *mo, AActor *BlockingMobj, bool ontop)
|
|||
|
||||
if (mo->BounceFlags & (BOUNCE_HereticType | BOUNCE_MBF))
|
||||
{
|
||||
mo->Vel.Z -= 2. / dot;
|
||||
mo->Vel.Z -= 2. * dot;
|
||||
if (!(mo->BounceFlags & BOUNCE_MBF)) // Heretic projectiles die, MBF projectiles don't.
|
||||
{
|
||||
mo->flags |= MF_INBOUNCE;
|
||||
|
@ -3591,7 +3596,7 @@ bool P_BounceActor(AActor *mo, AActor *BlockingMobj, bool ontop)
|
|||
else // Don't run through this for MBF-style bounces
|
||||
{
|
||||
// The reflected velocity keeps only about 70% of its original speed
|
||||
mo->Vel.Z = (mo->Vel.Z - 2. / dot) * mo->bouncefactor;
|
||||
mo->Vel.Z = (mo->Vel.Z - 2. * dot) * mo->bouncefactor;
|
||||
}
|
||||
|
||||
mo->PlayBounceSound(true);
|
||||
|
|
|
@ -434,8 +434,6 @@ void LoadActors()
|
|||
// PASSMOBJ is irrelevant for normal missiles, but not for bouncers.
|
||||
defaults->flags2 |= MF2_PASSMOBJ;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (FScriptPosition::ErrorCounter > 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue