- added ML_BLOCKPROJECTILE flag to lines.

SVN r1440 (trunk)
This commit is contained in:
Christoph Oelckers 2009-02-22 15:39:42 +00:00
commit 613ae5e022
7 changed files with 49 additions and 4 deletions

View file

@ -149,6 +149,7 @@ enum ELineFlags
ML_3DMIDTEX = 0x00200000,
ML_CHECKSWITCHRANGE = 0x00400000,
ML_FIRSTSIDEONLY = 0x00800000, // activated only when crossed from front side
ML_BLOCKPROJECTILE = 0x01000000,
};

View file

@ -409,5 +409,6 @@ xx(light)
xx(lightabsolute)
xx(nofakecontrast)
xx(smoothlighting)
xx(blockprojectiles)
xx(Renderstyle)

View file

@ -2357,6 +2357,39 @@ FUNC(LS_Line_SetTextureOffset)
return true;
}
FUNC(LS_Line_SetBlocking)
// Line_SetBlocking (id, setflags, clearflags)
{
static const int flagtrans[] =
{
ML_BLOCKING,
ML_BLOCKMONSTERS,
ML_BLOCK_PLAYERS,
ML_BLOCK_FLOATERS,
ML_BLOCKPROJECTILE,
ML_BLOCKEVERYTHING,
ML_RAILING,
-1
};
if (arg0 == 0) return false;
int setflags = 0;
int clearflags = 0;
for(int i = 0; flagtrans[i] != -1; i++, arg1 >>= 1, arg2 >>= 1)
{
if (arg1 & 1) setflags |= flagtrans[i];
if (arg2 & 1) clearflags |= flagtrans[i];
}
for(int line = -1; (line = P_FindLineFromID (arg0, line)) >= 0; )
{
lines[line].flags = (lines[line].flags & ~clearflags) | setflags;
}
return true;
}
FUNC(LS_ChangeCamera)
@ -2942,8 +2975,8 @@ lnSpecFunc LineSpecials[256] =
LS_Sector_SetLink,
LS_Scroll_Wall,
LS_Line_SetTextureOffset,
LS_NOP, // 54
LS_NOP, // 55
LS_Sector_ChangeFlags,
LS_Line_SetBlocking,
LS_NOP, // 56
LS_NOP, // 57
LS_NOP, // 58

View file

@ -562,7 +562,7 @@ bool PIT_CheckLine (line_t *ld, const FBoundingBox &box, FCheckPosition &tm)
return false;
}
if (!(tm.thing->flags & MF_MISSILE) || (ld->flags & ML_BLOCKEVERYTHING))
if (!(tm.thing->flags & MF_MISSILE) || (ld->flags & (ML_BLOCKEVERYTHING|ML_BLOCKPROJECTILE)))
{
if (ld->flags & ML_RAILING)
{
@ -571,6 +571,7 @@ bool PIT_CheckLine (line_t *ld, const FBoundingBox &box, FCheckPosition &tm)
else if ((ld->flags & (ML_BLOCKING|ML_BLOCKEVERYTHING)) || // explicitly blocking everything
(!(tm.thing->flags3 & MF3_NOBLOCKMONST) && (ld->flags & ML_BLOCKMONSTERS)) || // block monsters only
(tm.thing->player != NULL && (ld->flags & ML_BLOCK_PLAYERS)) || // block players
((tm.thing->flags & MF_MISSILE) && (ld->flags & ML_BLOCKPROJECTILE)) || // block projectiles
((ld->flags & ML_BLOCK_FLOATERS) && (tm.thing->flags & MF_FLOAT))) // block floaters
{
if (tm.thing->flags2 & MF2_BLASTED)

View file

@ -628,6 +628,10 @@ struct UDMFParser
Flag(ld->flags, ML_FIRSTSIDEONLY, key);
break;
case NAME_blockprojectiles:
Flag(ld->flags, ML_BLOCKPROJECTILE, key);
break;
default:
break;
}