mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 20:43:15 +00:00
- The bouncing check from r3643 cannot be applied retroactively to the existing DOOMBOUNCE flag because mods depend on the old behavior. Instead of modifying BOUNCE_OnOff's behavior the correct way of doing this has to be implemented as a separate flag in order to avoid problems.
SVN r3685 (trunk)
This commit is contained in:
parent
e094e1b515
commit
3d7c6811c1
4 changed files with 13 additions and 7 deletions
|
@ -402,7 +402,7 @@ enum EBounceFlags
|
|||
BOUNCE_Ceilings = 1<<2, // bounces off of ceilings
|
||||
BOUNCE_Actors = 1<<3, // bounces off of some actors
|
||||
BOUNCE_AllActors = 1<<4, // bounces off of all actors (requires BOUNCE_Actors to be set, too)
|
||||
BOUNCE_AutoOff = 1<<5, // when bouncing off a floor, if the new Z velocity is below 3.0, disable further bouncing
|
||||
BOUNCE_AutoOff = 1<<5, // when bouncing off a sector plane, if the new Z velocity is below 3.0, disable further bouncing
|
||||
BOUNCE_HereticType = 1<<6, // goes into Death state when bouncing on floors or ceilings
|
||||
|
||||
BOUNCE_UseSeeSound = 1<<7, // compatibility fallback. This will only be set by
|
||||
|
@ -414,6 +414,7 @@ enum EBounceFlags
|
|||
// MBF bouncing is a bit different from other modes as Killough coded many special behavioral cases
|
||||
// for them that are not present in ZDoom, so it is necessary to identify it properly.
|
||||
BOUNCE_MBF = 1<<12, // This in itself is not a valid mode, but replaces MBF's MF_BOUNCE flag.
|
||||
BOUNCE_AutoOffFloorOnly = 1<<13, // like BOUNCE_AutoOff, but only on floors
|
||||
|
||||
BOUNCE_TypeMask = BOUNCE_Walls | BOUNCE_Floors | BOUNCE_Ceilings | BOUNCE_Actors | BOUNCE_AutoOff | BOUNCE_HereticType | BOUNCE_MBF,
|
||||
|
||||
|
|
|
@ -1822,7 +1822,7 @@ bool P_TryMove (AActor *thing, fixed_t x, fixed_t y,
|
|||
{
|
||||
goto pushline;
|
||||
}
|
||||
if (thing->flags6 & MF6_STEPMISSILE)
|
||||
if (thing->flags6 & MF6_STEPMISSILE)
|
||||
{
|
||||
thing->z = tm.floorz;
|
||||
// If moving down, cancel vertical component of the velocity
|
||||
|
@ -2925,7 +2925,7 @@ bool P_BounceActor (AActor *mo, AActor *BlockingMobj, bool ontop)
|
|||
if (abs(mo->velz) < (fixed_t)(mo->Mass * mo->GetGravity() / 64))
|
||||
mo->velz = 0;
|
||||
}
|
||||
else if (mo->BounceFlags & BOUNCE_AutoOff)
|
||||
else if (mo->BounceFlags & (BOUNCE_AutoOff|BOUNCE_AutoOffFloorOnly))
|
||||
{
|
||||
if (!(mo->flags & MF_NOGRAVITY) && (mo->velz < 3*FRACUNIT))
|
||||
mo->BounceFlags &= ~BOUNCE_TypeMask;
|
||||
|
|
|
@ -1444,10 +1444,14 @@ bool AActor::FloorBounceMissile (secplane_t &plane)
|
|||
if (abs(velz) < (fixed_t)(Mass * GetGravity() / 64))
|
||||
velz = 0;
|
||||
}
|
||||
else if (plane.c > 0 && BounceFlags & BOUNCE_AutoOff)
|
||||
{ // AutoOff only works when bouncing off a floor, not a ceiling.
|
||||
if (!(flags & MF_NOGRAVITY) && (velz < 3*FRACUNIT))
|
||||
BounceFlags &= ~BOUNCE_TypeMask;
|
||||
else if (BounceFlags & (BOUNCE_AutoOff|BOUNCE_AutoOffFloorOnly))
|
||||
{
|
||||
if (plane.c > 0 || (BounceFlags & BOUNCE_AutoOff))
|
||||
{
|
||||
// AutoOff only works when bouncing off a floor, not a ceiling (or in compatibility mode.)
|
||||
if (!(flags & MF_NOGRAVITY) && (velz < 3*FRACUNIT))
|
||||
BounceFlags &= ~BOUNCE_TypeMask;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -256,6 +256,7 @@ static FFlagDef ActorFlags[]=
|
|||
DEFINE_FLAG2(BOUNCE_AllActors, BOUNCEONACTORS, AActor, BounceFlags),
|
||||
DEFINE_FLAG2(BOUNCE_ExplodeOnWater, EXPLODEONWATER, AActor, BounceFlags),
|
||||
DEFINE_FLAG2(BOUNCE_MBF, MBFBOUNCER, AActor, BounceFlags),
|
||||
DEFINE_FLAG2(BOUNCE_AutoOffFloorOnly, BOUNCEAUTOOFFFLOORONLY, AActor, BounceFlags),
|
||||
|
||||
// Deprecated flags. Handling must be performed in HandleDeprecatedFlags
|
||||
DEFINE_DEPRECATED_FLAG(FIREDAMAGE),
|
||||
|
|
Loading…
Reference in a new issue