mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-12-04 01:41:42 +00:00
Fixed incorrect autooff behavior on ceiling bounce (#2837)
* Fixed incorrect autooff behavior on ceiling bounce * Fixed incorrect Actor bouncing behavior
This commit is contained in:
parent
f911088074
commit
1d35ff8bc7
2 changed files with 8 additions and 4 deletions
|
@ -3792,7 +3792,8 @@ 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 -= 2. * dot;
|
||||
mo->Vel *= mo->bouncefactor;
|
||||
}
|
||||
|
||||
mo->PlayBounceSound(true);
|
||||
|
@ -3803,8 +3804,11 @@ bool P_BounceActor(AActor *mo, AActor *BlockingMobj, bool ontop)
|
|||
}
|
||||
else if (mo->BounceFlags & (BOUNCE_AutoOff | BOUNCE_AutoOffFloorOnly))
|
||||
{
|
||||
if (!(mo->flags & MF_NOGRAVITY) && (mo->Vel.Z < 3.))
|
||||
mo->BounceFlags &= ~BOUNCE_TypeMask;
|
||||
if (mo->Vel.Z >= 0 || (mo->BounceFlags & BOUNCE_AutoOff))
|
||||
{
|
||||
if (!(mo->flags & MF_NOGRAVITY) && (mo->Vel.Z < 3.))
|
||||
mo->BounceFlags &= ~BOUNCE_TypeMask;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mo->BounceFlags & BOUNCE_UseBounceState)
|
||||
|
|
|
@ -1857,7 +1857,7 @@ bool AActor::FloorBounceMissile (secplane_t &plane, bool is3DFloor)
|
|||
if (norm.Z > 0 || (BounceFlags & BOUNCE_AutoOff))
|
||||
{
|
||||
// AutoOff only works when bouncing off a floor, not a ceiling (or in compatibility mode.)
|
||||
if (!(flags & MF_NOGRAVITY) && ((Vel | norm) < 3))
|
||||
if (!(flags & MF_NOGRAVITY) && (norm.Z < 0 || ((Vel | norm) < 3)))
|
||||
BounceFlags &= ~BOUNCE_TypeMask;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue