Replace "Block Enemies" with "Block Players"

We don't need the ability to make invisible walls for enemies as often as we've needed invisible walls for players that don't block their thrown items.
This commit is contained in:
Sally Cochenour 2020-03-21 19:08:59 -04:00
parent 21f28b27f5
commit 58df481cd3
7 changed files with 29 additions and 29 deletions

View file

@ -8175,8 +8175,8 @@ static const char *const PLAYERFLAG_LIST[] = {
#ifdef HAVE_BLUA #ifdef HAVE_BLUA
// Linedef flags // Linedef flags
static const char *const ML_LIST[16] = { static const char *const ML_LIST[16] = {
"IMPASSIBLE", "IMPASSABLE",
"BLOCKMONSTERS", "BLOCKPLAYERS",
"TWOSIDED", "TWOSIDED",
"DONTPEGTOP", "DONTPEGTOP",
"DONTPEGBOTTOM", "DONTPEGBOTTOM",

View file

@ -94,10 +94,10 @@ typedef struct
// //
// Solid, is an obstacle. // Solid, is an obstacle.
#define ML_IMPASSIBLE 1 #define ML_IMPASSABLE 1
// Blocks monsters only. // SRB2Kart: Blocks players only; items can be thrown through these.
#define ML_BLOCKMONSTERS 2 #define ML_BLOCKPLAYERS 2
// Backside will not be present at all if not two sided. // Backside will not be present at all if not two sided.
#define ML_TWOSIDED 4 #define ML_TWOSIDED 4

View file

@ -484,7 +484,7 @@ INT32 EV_DoCeiling(line_t *line, ceiling_e type)
} }
// chained linedef executing ability // chained linedef executing ability
if (line->flags & ML_BLOCKMONSTERS) if (line->flags & ML_BLOCKPLAYERS)
{ {
// only set it on ONE of the moving sectors (the smallest numbered) // only set it on ONE of the moving sectors (the smallest numbered)
// and front side x offset must be positive // and front side x offset must be positive

View file

@ -2747,7 +2747,7 @@ INT32 EV_DoFloor(line_t *line, floor_e floortype)
dofloor->direction = -1; // down dofloor->direction = -1; // down
// chained linedef executing ability // chained linedef executing ability
if (line->flags & ML_BLOCKMONSTERS) if (line->flags & ML_BLOCKPLAYERS)
{ {
// Only set it on one of the moving sectors (the // Only set it on one of the moving sectors (the
// smallest numbered) and only if the front side // smallest numbered) and only if the front side

View file

@ -2006,10 +2006,10 @@ if (tmthing->flags & MF_PAPERCOLLISION) // Caution! Turning whilst up against a
// missiles can cross uncrossable lines // missiles can cross uncrossable lines
if (!(tmthing->flags & MF_MISSILE)) if (!(tmthing->flags & MF_MISSILE))
{ {
if (ld->flags & ML_IMPASSIBLE) // block objects from moving through this linedef. if (ld->flags & ML_IMPASSABLE) // block objects from moving through this linedef.
return false; return false;
if ((tmthing->flags & (MF_ENEMY|MF_BOSS)) && ld->flags & ML_BLOCKMONSTERS) if (tmthing->player && ld->flags & ML_BLOCKPLAYERS)
return false; // block monsters only return false; // SRB2Kart: Only block players, not items
} }
// set openrange, opentop, openbottom // set openrange, opentop, openbottom
@ -3328,10 +3328,10 @@ static boolean PTR_SlideTraverse(intercept_t *in)
if (!(slidemo->flags & MF_MISSILE)) if (!(slidemo->flags & MF_MISSILE))
{ {
if (li->flags & ML_IMPASSIBLE) if (li->flags & ML_IMPASSABLE)
goto isblocking; goto isblocking;
if ((slidemo->flags & (MF_ENEMY|MF_BOSS)) && li->flags & ML_BLOCKMONSTERS) if (slidemo->player && li->flags & ML_BLOCKPLAYERS)
goto isblocking; goto isblocking;
} }

View file

@ -2179,7 +2179,7 @@ boolean P_CheckSolidLava(mobj_t *mo, ffloor_t *rover)
*rover->topheight; *rover->topheight;
if (rover->flags & FF_SWIMMABLE && GETSECSPECIAL(rover->master->frontsector->special, 1) == 3 if (rover->flags & FF_SWIMMABLE && GETSECSPECIAL(rover->master->frontsector->special, 1) == 3
&& !(rover->master->flags & ML_BLOCKMONSTERS) && !(rover->master->flags & ML_BLOCKPLAYERS)
&& ((rover->master->flags & ML_EFFECT3) || mo->z-mo->momz > topheight - FixedMul(16*FRACUNIT, mo->scale))) && ((rover->master->flags & ML_EFFECT3) || mo->z-mo->momz > topheight - FixedMul(16*FRACUNIT, mo->scale)))
return true; return true;
} }

View file

@ -1651,7 +1651,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
if (rings > dist) if (rings > dist)
return false; return false;
} }
else if (triggerline->flags & ML_BLOCKMONSTERS) else if (triggerline->flags & ML_BLOCKPLAYERS)
{ {
if (rings < dist) if (rings < dist)
return false; return false;
@ -1729,7 +1729,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
if (lap < (sides[triggerline->sidenum[0]].textureoffset >> FRACBITS)) if (lap < (sides[triggerline->sidenum[0]].textureoffset >> FRACBITS))
return false; return false;
} }
else if (triggerline->flags & ML_BLOCKMONSTERS) // Need lower than or equal to else if (triggerline->flags & ML_BLOCKPLAYERS) // Need lower than or equal to
{ {
if (lap > (sides[triggerline->sidenum[0]].textureoffset >> FRACBITS)) if (lap > (sides[triggerline->sidenum[0]].textureoffset >> FRACBITS))
return false; return false;
@ -2298,8 +2298,8 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
return; return;
if (bot) if (bot)
P_Teleport(bot, dest->x, dest->y, dest->z, (line->flags & ML_NOCLIMB) ? mo->angle : dest->angle, (line->flags & ML_BLOCKMONSTERS) == 0, (line->flags & ML_EFFECT4) == ML_EFFECT4); P_Teleport(bot, dest->x, dest->y, dest->z, (line->flags & ML_NOCLIMB) ? mo->angle : dest->angle, (line->flags & ML_BLOCKPLAYERS) == 0, (line->flags & ML_EFFECT4) == ML_EFFECT4);
if (line->flags & ML_BLOCKMONSTERS) if (line->flags & ML_BLOCKPLAYERS)
P_Teleport(mo, dest->x, dest->y, dest->z, (line->flags & ML_NOCLIMB) ? mo->angle : dest->angle, false, (line->flags & ML_EFFECT4) == ML_EFFECT4); P_Teleport(mo, dest->x, dest->y, dest->z, (line->flags & ML_NOCLIMB) ? mo->angle : dest->angle, false, (line->flags & ML_EFFECT4) == ML_EFFECT4);
else else
{ {
@ -2361,7 +2361,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
mapmusname[6] = 0; mapmusname[6] = 0;
mapmusflags = tracknum & MUSIC_TRACKMASK; mapmusflags = tracknum & MUSIC_TRACKMASK;
if (!(line->flags & ML_BLOCKMONSTERS)) if (!(line->flags & ML_BLOCKPLAYERS))
mapmusflags |= MUSIC_RELOADRESET; mapmusflags |= MUSIC_RELOADRESET;
if (line->flags & ML_BOUNCY) if (line->flags & ML_BOUNCY)
mapmusflags |= MUSIC_FORCERESET; mapmusflags |= MUSIC_FORCERESET;
@ -2381,7 +2381,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
} }
} }
// Except, you can use the ML_BLOCKMONSTERS flag to change this behavior. // Except, you can use the ML_BLOCKPLAYERS flag to change this behavior.
// if (mapmusflags & MUSIC_RELOADRESET) then it will reset the music in G_PlayerReborn. // if (mapmusflags & MUSIC_RELOADRESET) then it will reset the music in G_PlayerReborn.
} }
break; break;
@ -2451,7 +2451,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
// play the sound from nowhere // play the sound from nowhere
S_StartSound(NULL, sfxnum); S_StartSound(NULL, sfxnum);
} }
else if (line->flags & ML_BLOCKMONSTERS) else if (line->flags & ML_BLOCKPLAYERS)
{ {
// play the sound from calling sector's soundorg // play the sound from calling sector's soundorg
if (callsec) if (callsec)
@ -2800,7 +2800,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
var1 = sides[line->sidenum[0]].toptexture; //(line->dx>>FRACBITS)-1; var1 = sides[line->sidenum[0]].toptexture; //(line->dx>>FRACBITS)-1;
if (line->sidenum[1] != 0xffff && line->flags & ML_BLOCKMONSTERS) // read power from back sidedef if (line->sidenum[1] != 0xffff && line->flags & ML_BLOCKPLAYERS) // read power from back sidedef
var2 = sides[line->sidenum[1]].toptexture; var2 = sides[line->sidenum[1]].toptexture;
else if (line->flags & ML_NOCLIMB) // 'Infinite' else if (line->flags & ML_NOCLIMB) // 'Infinite'
var2 = UINT16_MAX; var2 = UINT16_MAX;
@ -3956,7 +3956,7 @@ DoneSection2:
if (gametype == GT_COOP && lineindex != -1) // Custom exit! if (gametype == GT_COOP && lineindex != -1) // Custom exit!
{ {
// Special goodies with the block monsters flag depending on emeralds collected // Special goodies with the block monsters flag depending on emeralds collected
if ((lines[lineindex].flags & ML_BLOCKMONSTERS) && ALL7EMERALDS(emeralds)) if ((lines[lineindex].flags & ML_BLOCKPLAYERS) && ALL7EMERALDS(emeralds))
nextmapoverride = (INT16)(lines[lineindex].frontsector->ceilingheight>>FRACBITS); nextmapoverride = (INT16)(lines[lineindex].frontsector->ceilingheight>>FRACBITS);
else else
nextmapoverride = (INT16)(lines[lineindex].frontsector->floorheight>>FRACBITS); nextmapoverride = (INT16)(lines[lineindex].frontsector->floorheight>>FRACBITS);
@ -5349,7 +5349,7 @@ static void P_AddRaiseThinker(sector_t *sec, line_t *sourceline)
raise->thinker.function.acp1 = (actionf_p1)T_RaiseSector; raise->thinker.function.acp1 = (actionf_p1)T_RaiseSector;
if (sourceline->flags & ML_BLOCKMONSTERS) if (sourceline->flags & ML_BLOCKPLAYERS)
raise->vars[0] = 1; raise->vars[0] = 1;
else else
raise->vars[0] = 0; raise->vars[0] = 0;
@ -5408,7 +5408,7 @@ static void P_AddOldAirbob(sector_t *sec, line_t *sourceline, boolean noadjust)
airbob->vars[3] = airbob->vars[2]; airbob->vars[3] = airbob->vars[2];
if (sourceline->flags & ML_BLOCKMONSTERS) if (sourceline->flags & ML_BLOCKPLAYERS)
airbob->vars[0] = 1; airbob->vars[0] = 1;
else else
airbob->vars[0] = 0; airbob->vars[0] = 0;
@ -5989,7 +5989,7 @@ void P_SpawnSpecials(INT32 fromnetsave)
break; break;
case 64: // Appearing/Disappearing FOF option case 64: // Appearing/Disappearing FOF option
if (lines[i].flags & ML_BLOCKMONSTERS) { // Find FOFs by control sector tag if (lines[i].flags & ML_BLOCKPLAYERS) { // Find FOFs by control sector tag
for (s = -1; (s = P_FindSectorFromLineTag(lines + i, s)) >= 0 ;) for (s = -1; (s = P_FindSectorFromLineTag(lines + i, s)) >= 0 ;)
for (j = 0; (unsigned)j < sectors[s].linecount; j++) for (j = 0; (unsigned)j < sectors[s].linecount; j++)
if (sectors[s].lines[j]->special >= 100 && sectors[s].lines[j]->special < 300) if (sectors[s].lines[j]->special >= 100 && sectors[s].lines[j]->special < 300)
@ -6217,7 +6217,7 @@ void P_SpawnSpecials(INT32 fromnetsave)
case 150: // Air bobbing platform case 150: // Air bobbing platform
case 151: // Adjustable air bobbing platform case 151: // Adjustable air bobbing platform
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL, secthinkers); P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL, secthinkers);
lines[i].flags |= ML_BLOCKMONSTERS; lines[i].flags |= ML_BLOCKPLAYERS;
P_AddOldAirbob(lines[i].frontsector, lines + i, (lines[i].special != 151)); P_AddOldAirbob(lines[i].frontsector, lines + i, (lines[i].special != 151));
break; break;
case 152: // Adjustable air bobbing platform in reverse case 152: // Adjustable air bobbing platform in reverse
@ -6272,14 +6272,14 @@ void P_SpawnSpecials(INT32 fromnetsave)
case 176: // Air bobbing platform that will crumble and bob on the water when it falls and hits case 176: // Air bobbing platform that will crumble and bob on the water when it falls and hits
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_FLOATBOB|FF_CRUMBLE, secthinkers); P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_FLOATBOB|FF_CRUMBLE, secthinkers);
lines[i].flags |= ML_BLOCKMONSTERS; lines[i].flags |= ML_BLOCKPLAYERS;
P_AddOldAirbob(lines[i].frontsector, lines + i, true); P_AddOldAirbob(lines[i].frontsector, lines + i, true);
break; break;
case 177: // Air bobbing platform that will crumble and bob on case 177: // Air bobbing platform that will crumble and bob on
// the water when it falls and hits, then never return // the water when it falls and hits, then never return
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL|FF_FLOATBOB|FF_CRUMBLE|FF_NORETURN, secthinkers); P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL|FF_FLOATBOB|FF_CRUMBLE|FF_NORETURN, secthinkers);
lines[i].flags |= ML_BLOCKMONSTERS; lines[i].flags |= ML_BLOCKPLAYERS;
P_AddOldAirbob(lines[i].frontsector, lines + i, true); P_AddOldAirbob(lines[i].frontsector, lines + i, true);
break; break;
@ -6293,7 +6293,7 @@ void P_SpawnSpecials(INT32 fromnetsave)
case 180: // Air bobbing platform that will crumble case 180: // Air bobbing platform that will crumble
P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL|FF_CRUMBLE, secthinkers); P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL|FF_CRUMBLE, secthinkers);
lines[i].flags |= ML_BLOCKMONSTERS; lines[i].flags |= ML_BLOCKPLAYERS;
P_AddOldAirbob(lines[i].frontsector, lines + i, true); P_AddOldAirbob(lines[i].frontsector, lines + i, true);
break; break;