mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 20:43:15 +00:00
Merge remote-tracking branch 'remotes/origin/master' into asmjit
This commit is contained in:
commit
b26b16e4b7
7 changed files with 28 additions and 8 deletions
|
@ -488,6 +488,7 @@ enum ActorBounceFlag
|
|||
BOUNCE_UseBounceState = 1<<14, // Use Bounce[.*] states
|
||||
BOUNCE_NotOnShootables = 1<<15, // do not bounce off shootable actors if we are a projectile. Explode instead.
|
||||
BOUNCE_BounceOnUnrips = 1<<16, // projectile bounces on actors with DONTRIP
|
||||
BOUNCE_NotOnSky = 1<<17, // Don't bounce on sky floors / ceilings / walls
|
||||
|
||||
BOUNCE_TypeMask = BOUNCE_Walls | BOUNCE_Floors | BOUNCE_Ceilings | BOUNCE_Actors | BOUNCE_AutoOff | BOUNCE_HereticType | BOUNCE_MBF,
|
||||
|
||||
|
@ -1373,7 +1374,7 @@ public:
|
|||
DVector3 PosRelative(int grp) const;
|
||||
DVector3 PosRelative(const AActor *other) const;
|
||||
DVector3 PosRelative(sector_t *sec) const;
|
||||
DVector3 PosRelative(line_t *line) const;
|
||||
DVector3 PosRelative(const line_t *line) const;
|
||||
|
||||
FVector3 SoundPos() const
|
||||
{
|
||||
|
|
|
@ -20,7 +20,7 @@ inline DVector3 AActor::PosRelative(sector_t *sec) const
|
|||
return Pos() + level.Displacements.getOffset(Sector->PortalGroup, sec->PortalGroup);
|
||||
}
|
||||
|
||||
inline DVector3 AActor::PosRelative(line_t *line) const
|
||||
inline DVector3 AActor::PosRelative(const line_t *line) const
|
||||
{
|
||||
return Pos() + level.Displacements.getOffset(Sector->PortalGroup, line->frontsector->PortalGroup);
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "doomdata.h"
|
||||
#include "g_level.h"
|
||||
#include "r_defs.h"
|
||||
#include "r_sky.h"
|
||||
#include "portal.h"
|
||||
#include "p_blockmap.h"
|
||||
#include "p_local.h"
|
||||
|
@ -325,3 +326,10 @@ inline int line_t::getPortalAlignment() const
|
|||
{
|
||||
return portalindex >= level.linePortals.Size() ? 0 : level.linePortals[portalindex].mAlign;
|
||||
}
|
||||
|
||||
inline bool line_t::hitSkyWall(AActor* mo) const
|
||||
{
|
||||
return backsector &&
|
||||
backsector->GetTexture(sector_t::ceiling) == skyflatnum &&
|
||||
mo->Z() >= backsector->ceilingplane.ZatPoint(mo->PosRelative(this));
|
||||
}
|
||||
|
|
|
@ -3570,9 +3570,9 @@ bool FSlide::BounceWall(AActor *mo)
|
|||
}
|
||||
line = bestslideline;
|
||||
|
||||
if (line->special == Line_Horizon)
|
||||
if (line->special == Line_Horizon || (mo->BounceFlags & BOUNCE_NotOnSky) && line->hitSkyWall(mo))
|
||||
{
|
||||
mo->SeeSound = 0; // it might make a sound otherwise
|
||||
mo->SeeSound = mo->BounceSound = 0; // it might make a sound otherwise
|
||||
mo->Destroy();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -2189,15 +2189,27 @@ bool AActor::FloorBounceMissile (secplane_t &plane)
|
|||
}
|
||||
}
|
||||
|
||||
bool onsky;
|
||||
|
||||
if (plane.fC() < 0)
|
||||
{ // on ceiling
|
||||
if (!(BounceFlags & BOUNCE_Ceilings))
|
||||
return true;
|
||||
|
||||
onsky = ceilingpic == skyflatnum;
|
||||
}
|
||||
else
|
||||
{ // on floor
|
||||
if (!(BounceFlags & BOUNCE_Floors))
|
||||
return true;
|
||||
|
||||
onsky = floorpic == skyflatnum;
|
||||
}
|
||||
|
||||
if (onsky && (BounceFlags & BOUNCE_NotOnSky))
|
||||
{
|
||||
Destroy();
|
||||
return true;
|
||||
}
|
||||
|
||||
// The amount of bounces is limited
|
||||
|
@ -2762,10 +2774,7 @@ double P_XYMovement (AActor *mo, DVector2 scroll)
|
|||
explode:
|
||||
// explode a missile
|
||||
bool onsky = false;
|
||||
if (tm.ceilingline &&
|
||||
tm.ceilingline->backsector &&
|
||||
tm.ceilingline->backsector->GetTexture(sector_t::ceiling) == skyflatnum &&
|
||||
mo->Z() >= tm.ceilingline->backsector->ceilingplane.ZatPoint(mo->PosRelative(tm.ceilingline)))
|
||||
if (tm.ceilingline && tm.ceilingline->hitSkyWall(mo))
|
||||
{
|
||||
if (!(mo->flags3 & MF3_SKYEXPLODE))
|
||||
{
|
||||
|
|
|
@ -1373,6 +1373,7 @@ struct line_t
|
|||
inline bool isVisualPortal() const;
|
||||
inline line_t *getPortalDestination() const;
|
||||
inline int getPortalAlignment() const;
|
||||
inline bool hitSkyWall(AActor* mo) const;
|
||||
|
||||
int Index() const;
|
||||
};
|
||||
|
|
|
@ -360,6 +360,7 @@ static FFlagDef ActorFlagDefs[]=
|
|||
DEFINE_FLAG2(BOUNCE_UseBounceState, USEBOUNCESTATE, AActor, BounceFlags),
|
||||
DEFINE_FLAG2(BOUNCE_NotOnShootables, DONTBOUNCEONSHOOTABLES, AActor, BounceFlags),
|
||||
DEFINE_FLAG2(BOUNCE_BounceOnUnrips, BOUNCEONUNRIPPABLES, AActor, BounceFlags),
|
||||
DEFINE_FLAG2(BOUNCE_NotOnSky, DONTBOUNCEONSKY, AActor, BounceFlags),
|
||||
};
|
||||
|
||||
// These won't be accessible through bitfield variables
|
||||
|
|
Loading…
Reference in a new issue