mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-29 07:12:36 +00:00
BLOCKASPLAYER flag: treat non-player actors as blockable by "block players" lines
This commit is contained in:
parent
2f6dc46f14
commit
fae514f30d
4 changed files with 9 additions and 4 deletions
|
@ -401,6 +401,7 @@ enum ActorFlag8
|
||||||
{
|
{
|
||||||
MF8_FRIGHTENING = 0x00000001, // for those moments when halloween just won't do
|
MF8_FRIGHTENING = 0x00000001, // for those moments when halloween just won't do
|
||||||
MF8_INSCROLLSEC = 0x00000002, // actor is partially inside a scrolling sector
|
MF8_INSCROLLSEC = 0x00000002, // actor is partially inside a scrolling sector
|
||||||
|
MF8_BLOCKASPLAYER = 0x00000004, // actor is blocked by player-blocking lines even if not a player
|
||||||
};
|
};
|
||||||
|
|
||||||
// --- mobj.renderflags ---
|
// --- mobj.renderflags ---
|
||||||
|
|
|
@ -930,7 +930,10 @@ bool PIT_CheckLine(FMultiBlockLinesIterator &mit, FMultiBlockLinesIterator::Chec
|
||||||
bool NotBlocked = ((tm.thing->flags3 & MF3_NOBLOCKMONST)
|
bool NotBlocked = ((tm.thing->flags3 & MF3_NOBLOCKMONST)
|
||||||
|| ((i_compatflags & COMPATF_NOBLOCKFRIENDS) && (tm.thing->flags & MF_FRIENDLY)));
|
|| ((i_compatflags & COMPATF_NOBLOCKFRIENDS) && (tm.thing->flags & MF_FRIENDLY)));
|
||||||
|
|
||||||
if (!(Projectile) || (ld->flags & (ML_BLOCKEVERYTHING | ML_BLOCKPROJECTILE)))
|
uint32_t ProjectileBlocking = ML_BLOCKEVERYTHING | ML_BLOCKPROJECTILE;
|
||||||
|
if ( tm.thing->flags8 & MF8_BLOCKASPLAYER ) ProjectileBlocking |= ML_BLOCK_PLAYERS | ML_BLOCKING;
|
||||||
|
|
||||||
|
if (!(Projectile) || (ld->flags & ProjectileBlocking) )
|
||||||
{
|
{
|
||||||
if (ld->flags & ML_RAILING)
|
if (ld->flags & ML_RAILING)
|
||||||
{
|
{
|
||||||
|
@ -938,7 +941,7 @@ bool PIT_CheckLine(FMultiBlockLinesIterator &mit, FMultiBlockLinesIterator::Chec
|
||||||
}
|
}
|
||||||
else if ((ld->flags & (ML_BLOCKING | ML_BLOCKEVERYTHING)) || // explicitly blocking everything
|
else if ((ld->flags & (ML_BLOCKING | ML_BLOCKEVERYTHING)) || // explicitly blocking everything
|
||||||
(!(NotBlocked) && (ld->flags & ML_BLOCKMONSTERS)) || // block monsters only
|
(!(NotBlocked) && (ld->flags & ML_BLOCKMONSTERS)) || // block monsters only
|
||||||
(tm.thing->player != NULL && (ld->flags & ML_BLOCK_PLAYERS)) || // block players
|
(((tm.thing->player != NULL) || (tm.thing->flags8 & MF8_BLOCKASPLAYER)) && (ld->flags & ML_BLOCK_PLAYERS)) || // block players
|
||||||
((Projectile) && (ld->flags & ML_BLOCKPROJECTILE)) || // block projectiles
|
((Projectile) && (ld->flags & ML_BLOCKPROJECTILE)) || // block projectiles
|
||||||
((tm.thing->flags & MF_FLOAT) && (ld->flags & ML_BLOCK_FLOATERS))) // block floaters
|
((tm.thing->flags & MF_FLOAT) && (ld->flags & ML_BLOCK_FLOATERS))) // block floaters
|
||||||
{
|
{
|
||||||
|
@ -3100,7 +3103,7 @@ void FSlide::SlideTraverse(const DVector2 &start, const DVector2 &end)
|
||||||
{
|
{
|
||||||
goto isblocking;
|
goto isblocking;
|
||||||
}
|
}
|
||||||
if (li->flags & ML_BLOCK_PLAYERS && slidemo->player != NULL)
|
if (li->flags & ML_BLOCK_PLAYERS && ((slidemo->player != NULL) || (slidemo->flags8 & MF8_BLOCKASPLAYER)))
|
||||||
{
|
{
|
||||||
goto isblocking;
|
goto isblocking;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1157,7 +1157,7 @@ bool FPolyObj::CheckMobjBlocking (side_t *sd)
|
||||||
// [TN] Check wether this actor gets blocked by the line.
|
// [TN] Check wether this actor gets blocked by the line.
|
||||||
if (ld->backsector != NULL &&
|
if (ld->backsector != NULL &&
|
||||||
!(ld->flags & (ML_BLOCKING|ML_BLOCKEVERYTHING))
|
!(ld->flags & (ML_BLOCKING|ML_BLOCKEVERYTHING))
|
||||||
&& !(ld->flags & ML_BLOCK_PLAYERS && mobj->player)
|
&& !(ld->flags & ML_BLOCK_PLAYERS && (mobj->player || (mobj->flags8 & MF8_BLOCKASPLAYER)))
|
||||||
&& !(ld->flags & ML_BLOCKMONSTERS && mobj->flags3 & MF3_ISMONSTER)
|
&& !(ld->flags & ML_BLOCKMONSTERS && mobj->flags3 & MF3_ISMONSTER)
|
||||||
&& !((mobj->flags & MF_FLOAT) && (ld->flags & ML_BLOCK_FLOATERS))
|
&& !((mobj->flags & MF_FLOAT) && (ld->flags & ML_BLOCK_FLOATERS))
|
||||||
&& (!(ld->flags & ML_3DMIDTEX) ||
|
&& (!(ld->flags & ML_3DMIDTEX) ||
|
||||||
|
|
|
@ -316,6 +316,7 @@ static FFlagDef ActorFlagDefs[]=
|
||||||
DEFINE_FLAG(MF7, FORCEINFIGHTING, AActor, flags7),
|
DEFINE_FLAG(MF7, FORCEINFIGHTING, AActor, flags7),
|
||||||
|
|
||||||
DEFINE_FLAG(MF8, FRIGHTENING, AActor, flags8),
|
DEFINE_FLAG(MF8, FRIGHTENING, AActor, flags8),
|
||||||
|
DEFINE_FLAG(MF8, BLOCKASPLAYER, AActor, flags8),
|
||||||
|
|
||||||
// Effect flags
|
// Effect flags
|
||||||
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),
|
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),
|
||||||
|
|
Loading…
Reference in a new issue