From 58df481cd3795bdb2c7e43943ce956541f010d69 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Sat, 21 Mar 2020 19:08:59 -0400 Subject: [PATCH] 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. --- src/dehacked.c | 4 ++-- src/doomdata.h | 6 +++--- src/p_ceilng.c | 2 +- src/p_floor.c | 2 +- src/p_map.c | 10 +++++----- src/p_mobj.c | 2 +- src/p_spec.c | 32 ++++++++++++++++---------------- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 8a8a159db..7f5b7037f 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8175,8 +8175,8 @@ static const char *const PLAYERFLAG_LIST[] = { #ifdef HAVE_BLUA // Linedef flags static const char *const ML_LIST[16] = { - "IMPASSIBLE", - "BLOCKMONSTERS", + "IMPASSABLE", + "BLOCKPLAYERS", "TWOSIDED", "DONTPEGTOP", "DONTPEGBOTTOM", diff --git a/src/doomdata.h b/src/doomdata.h index 6319238b7..5e6324ec9 100644 --- a/src/doomdata.h +++ b/src/doomdata.h @@ -94,10 +94,10 @@ typedef struct // // Solid, is an obstacle. -#define ML_IMPASSIBLE 1 +#define ML_IMPASSABLE 1 -// Blocks monsters only. -#define ML_BLOCKMONSTERS 2 +// SRB2Kart: Blocks players only; items can be thrown through these. +#define ML_BLOCKPLAYERS 2 // Backside will not be present at all if not two sided. #define ML_TWOSIDED 4 diff --git a/src/p_ceilng.c b/src/p_ceilng.c index 757edebae..a2db42b2d 100644 --- a/src/p_ceilng.c +++ b/src/p_ceilng.c @@ -484,7 +484,7 @@ INT32 EV_DoCeiling(line_t *line, ceiling_e type) } // 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) // and front side x offset must be positive diff --git a/src/p_floor.c b/src/p_floor.c index 737a8810b..b6296090b 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -2747,7 +2747,7 @@ INT32 EV_DoFloor(line_t *line, floor_e floortype) dofloor->direction = -1; // down // 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) and only if the front side diff --git a/src/p_map.c b/src/p_map.c index 9e34e04d9..cf6670806 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2006,10 +2006,10 @@ if (tmthing->flags & MF_PAPERCOLLISION) // Caution! Turning whilst up against a // missiles can cross uncrossable lines 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; - if ((tmthing->flags & (MF_ENEMY|MF_BOSS)) && ld->flags & ML_BLOCKMONSTERS) - return false; // block monsters only + if (tmthing->player && ld->flags & ML_BLOCKPLAYERS) + return false; // SRB2Kart: Only block players, not items } // set openrange, opentop, openbottom @@ -3328,10 +3328,10 @@ static boolean PTR_SlideTraverse(intercept_t *in) if (!(slidemo->flags & MF_MISSILE)) { - if (li->flags & ML_IMPASSIBLE) + if (li->flags & ML_IMPASSABLE) goto isblocking; - if ((slidemo->flags & (MF_ENEMY|MF_BOSS)) && li->flags & ML_BLOCKMONSTERS) + if (slidemo->player && li->flags & ML_BLOCKPLAYERS) goto isblocking; } diff --git a/src/p_mobj.c b/src/p_mobj.c index a532dddc5..a728e5ed6 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2179,7 +2179,7 @@ boolean P_CheckSolidLava(mobj_t *mo, ffloor_t *rover) *rover->topheight; 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))) return true; } diff --git a/src/p_spec.c b/src/p_spec.c index bfbdf6228..a2ed7eb71 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -1651,7 +1651,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller if (rings > dist) return false; } - else if (triggerline->flags & ML_BLOCKMONSTERS) + else if (triggerline->flags & ML_BLOCKPLAYERS) { if (rings < dist) 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)) 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)) return false; @@ -2298,8 +2298,8 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) return; 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); - if (line->flags & ML_BLOCKMONSTERS) + 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_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); else { @@ -2361,7 +2361,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) mapmusname[6] = 0; mapmusflags = tracknum & MUSIC_TRACKMASK; - if (!(line->flags & ML_BLOCKMONSTERS)) + if (!(line->flags & ML_BLOCKPLAYERS)) mapmusflags |= MUSIC_RELOADRESET; if (line->flags & ML_BOUNCY) 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. } break; @@ -2451,7 +2451,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) // play the sound from nowhere S_StartSound(NULL, sfxnum); } - else if (line->flags & ML_BLOCKMONSTERS) + else if (line->flags & ML_BLOCKPLAYERS) { // play the sound from calling sector's soundorg 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; - 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; else if (line->flags & ML_NOCLIMB) // 'Infinite' var2 = UINT16_MAX; @@ -3956,7 +3956,7 @@ DoneSection2: if (gametype == GT_COOP && lineindex != -1) // Custom exit! { // 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); else 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; - if (sourceline->flags & ML_BLOCKMONSTERS) + if (sourceline->flags & ML_BLOCKPLAYERS) raise->vars[0] = 1; else 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]; - if (sourceline->flags & ML_BLOCKMONSTERS) + if (sourceline->flags & ML_BLOCKPLAYERS) airbob->vars[0] = 1; else airbob->vars[0] = 0; @@ -5989,7 +5989,7 @@ void P_SpawnSpecials(INT32 fromnetsave) break; 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 (j = 0; (unsigned)j < sectors[s].linecount; j++) 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 151: // Adjustable air bobbing platform 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)); break; 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 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); break; case 177: // Air bobbing platform that will crumble and bob on // 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); - lines[i].flags |= ML_BLOCKMONSTERS; + lines[i].flags |= ML_BLOCKPLAYERS; P_AddOldAirbob(lines[i].frontsector, lines + i, true); break; @@ -6293,7 +6293,7 @@ void P_SpawnSpecials(INT32 fromnetsave) case 180: // Air bobbing platform that will crumble 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); break;