Merge remote-tracking branch 'remotes/origin/master' into asmjit

This commit is contained in:
Christoph Oelckers 2018-11-30 21:29:12 +01:00
commit b26b16e4b7
7 changed files with 28 additions and 8 deletions

View File

@ -488,6 +488,7 @@ enum ActorBounceFlag
BOUNCE_UseBounceState = 1<<14, // Use Bounce[.*] states 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_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_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, 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(int grp) const;
DVector3 PosRelative(const AActor *other) const; DVector3 PosRelative(const AActor *other) const;
DVector3 PosRelative(sector_t *sec) const; DVector3 PosRelative(sector_t *sec) const;
DVector3 PosRelative(line_t *line) const; DVector3 PosRelative(const line_t *line) const;
FVector3 SoundPos() const FVector3 SoundPos() const
{ {

View File

@ -20,7 +20,7 @@ inline DVector3 AActor::PosRelative(sector_t *sec) const
return Pos() + level.Displacements.getOffset(Sector->PortalGroup, sec->PortalGroup); 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); return Pos() + level.Displacements.getOffset(Sector->PortalGroup, line->frontsector->PortalGroup);
} }

View File

@ -38,6 +38,7 @@
#include "doomdata.h" #include "doomdata.h"
#include "g_level.h" #include "g_level.h"
#include "r_defs.h" #include "r_defs.h"
#include "r_sky.h"
#include "portal.h" #include "portal.h"
#include "p_blockmap.h" #include "p_blockmap.h"
#include "p_local.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; 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));
}

View File

@ -3570,9 +3570,9 @@ bool FSlide::BounceWall(AActor *mo)
} }
line = bestslideline; 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(); mo->Destroy();
return true; return true;
} }

View File

@ -2189,15 +2189,27 @@ bool AActor::FloorBounceMissile (secplane_t &plane)
} }
} }
bool onsky;
if (plane.fC() < 0) if (plane.fC() < 0)
{ // on ceiling { // on ceiling
if (!(BounceFlags & BOUNCE_Ceilings)) if (!(BounceFlags & BOUNCE_Ceilings))
return true; return true;
onsky = ceilingpic == skyflatnum;
} }
else else
{ // on floor { // on floor
if (!(BounceFlags & BOUNCE_Floors)) if (!(BounceFlags & BOUNCE_Floors))
return true; return true;
onsky = floorpic == skyflatnum;
}
if (onsky && (BounceFlags & BOUNCE_NotOnSky))
{
Destroy();
return true;
} }
// The amount of bounces is limited // The amount of bounces is limited
@ -2762,10 +2774,7 @@ double P_XYMovement (AActor *mo, DVector2 scroll)
explode: explode:
// explode a missile // explode a missile
bool onsky = false; bool onsky = false;
if (tm.ceilingline && if (tm.ceilingline && tm.ceilingline->hitSkyWall(mo))
tm.ceilingline->backsector &&
tm.ceilingline->backsector->GetTexture(sector_t::ceiling) == skyflatnum &&
mo->Z() >= tm.ceilingline->backsector->ceilingplane.ZatPoint(mo->PosRelative(tm.ceilingline)))
{ {
if (!(mo->flags3 & MF3_SKYEXPLODE)) if (!(mo->flags3 & MF3_SKYEXPLODE))
{ {

View File

@ -1373,6 +1373,7 @@ struct line_t
inline bool isVisualPortal() const; inline bool isVisualPortal() const;
inline line_t *getPortalDestination() const; inline line_t *getPortalDestination() const;
inline int getPortalAlignment() const; inline int getPortalAlignment() const;
inline bool hitSkyWall(AActor* mo) const;
int Index() const; int Index() const;
}; };

View File

@ -360,6 +360,7 @@ static FFlagDef ActorFlagDefs[]=
DEFINE_FLAG2(BOUNCE_UseBounceState, USEBOUNCESTATE, AActor, BounceFlags), DEFINE_FLAG2(BOUNCE_UseBounceState, USEBOUNCESTATE, AActor, BounceFlags),
DEFINE_FLAG2(BOUNCE_NotOnShootables, DONTBOUNCEONSHOOTABLES, AActor, BounceFlags), DEFINE_FLAG2(BOUNCE_NotOnShootables, DONTBOUNCEONSHOOTABLES, AActor, BounceFlags),
DEFINE_FLAG2(BOUNCE_BounceOnUnrips, BOUNCEONUNRIPPABLES, AActor, BounceFlags), DEFINE_FLAG2(BOUNCE_BounceOnUnrips, BOUNCEONUNRIPPABLES, AActor, BounceFlags),
DEFINE_FLAG2(BOUNCE_NotOnSky, DONTBOUNCEONSKY, AActor, BounceFlags),
}; };
// These won't be accessible through bitfield variables // These won't be accessible through bitfield variables