From 6a9cc743ac347b1fd4da2b61027bf38ae317b394 Mon Sep 17 00:00:00 2001 From: NepDisk <16447892+NepDisk@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:45:52 -0400 Subject: [PATCH] Restore block monsters Block players is now on line special flag 81 --- src/doomdata.h | 4 ++-- src/p_ceilng.c | 2 +- src/p_floor.c | 2 +- src/p_map.c | 8 ++++---- src/p_mobj.c | 2 +- src/p_setup.c | 2 +- src/p_spec.c | 32 ++++++++++++++++---------------- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/doomdata.h b/src/doomdata.h index b891bc8a4..f09955793 100644 --- a/src/doomdata.h +++ b/src/doomdata.h @@ -102,8 +102,8 @@ typedef struct // Solid, is an obstacle. #define ML_IMPASSABLE 1 -// SRB2Kart: Blocks players only; items can be thrown through these. -#define ML_BLOCKPLAYERS 2 +// Blocks monsters only. +#define ML_BLOCKMONSTERS 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 062ebbda6..5e1aeab4c 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_BLOCKPLAYERS) + if (line->flags & ML_BLOCKMONSTERS) { // 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 d19c1f61e..0964e00c6 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -1831,7 +1831,7 @@ void EV_DoFloor(line_t *line, floor_e floortype) dofloor->direction = -1; // down // chained linedef executing ability - if (line->flags & ML_BLOCKPLAYERS) + if (line->flags & ML_BLOCKMONSTERS) { // 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 3b1ce67af..3eb010f59 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1477,9 +1477,9 @@ boolean P_IsLineBlocking(const line_t *ld, const mobj_t *thing) return ( (ld->flags & ML_IMPASSABLE) || // block objects from moving through this linedef. - (thing->player && !thing->player->spectator && - ld->flags & ML_BLOCKPLAYERS) || // SRB2Kart: Only block players, not items - ((thing->flags & (MF_ENEMY|MF_BOSS)) && ld->special == 81) // case 81: block monsters only + ((thing->flags & (MF_ENEMY|MF_BOSS)) && + ld->flags & ML_BLOCKMONSTERS) || + ((thing->player && !thing->player->spectator) && ld->special == 81) // case 81: Only block players ); } } @@ -3429,7 +3429,7 @@ static void P_CheckLavaWall(mobj_t *mo, sector_t *sec) if (GETSECSPECIAL(rover->master->frontsector->special, 1) != 3) continue; - if (rover->master->flags & ML_BLOCKPLAYERS) + if (rover->master->flags & ML_BLOCKMONSTERS) continue; topheight = P_GetFFloorTopZAt(rover, mo->x, mo->y); diff --git a/src/p_mobj.c b/src/p_mobj.c index 9df8f6c8c..1517ff318 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2077,7 +2077,7 @@ boolean P_CheckDeathPitCollide(mobj_t *mo) boolean P_CheckSolidLava(ffloor_t *rover) { if (rover->flags & FF_SWIMMABLE && GETSECSPECIAL(rover->master->frontsector->special, 1) == 3 - && !(rover->master->flags & ML_BLOCKPLAYERS)) + && !(rover->master->flags & ML_BLOCKMONSTERS)) return true; return false; diff --git a/src/p_setup.c b/src/p_setup.c index 20b94a942..e509fd879 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -1713,7 +1713,7 @@ static void ParseTextmapLinedefParameter(UINT32 i, char *param, char *val) else if (fastcmp(param, "blocking") && fastcmp("true", val)) lines[i].flags |= ML_IMPASSABLE; else if (fastcmp(param, "blockplayers") && fastcmp("true", val)) - lines[i].flags |= ML_BLOCKPLAYERS; + lines[i].flags |= ML_BLOCKMONSTERS; else if (fastcmp(param, "twosided") && fastcmp("true", val)) lines[i].flags |= ML_TWOSIDED; else if (fastcmp(param, "dontpegtop") && fastcmp("true", val)) diff --git a/src/p_spec.c b/src/p_spec.c index 17402732f..d02754b26 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -1422,7 +1422,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller if (rings > dist) return false; } - else if (triggerline->flags & ML_BLOCKPLAYERS) + else if (triggerline->flags & ML_BLOCKMONSTERS) { if (rings < dist) return false; @@ -1992,7 +1992,7 @@ static void K_HandleLapIncrement(player_t *player) if (lap < (sides[lines[i].sidenum[0]].textureoffset >> FRACBITS)) continue; } - else if (lines[i].flags & ML_BLOCKPLAYERS) // Need lower than or equal to + else if (lines[i].flags & ML_BLOCKMONSTERS) // Need lower than or equal to { if (lap > (sides[lines[i].sidenum[0]].textureoffset >> FRACBITS)) continue; @@ -2123,7 +2123,7 @@ static void P_SwitchSkybox(INT32 ldflags, player_t *player, skybox_t *skybox) player->skybox.viewpoint = skybox->viewpoint; } - if (ldflags & ML_BLOCKPLAYERS) // Block Enemies turns ON centerpoint setting + if (ldflags & ML_BLOCKMONSTERS) // Block Enemies turns ON centerpoint setting { player->skybox.centerpoint = skybox->centerpoint; } @@ -2310,7 +2310,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) if (!dest) return; - if (line->flags & ML_BLOCKPLAYERS) + if (line->flags & ML_BLOCKMONSTERS) 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 { @@ -2372,7 +2372,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_BLOCKPLAYERS)) + if (!(line->flags & ML_BLOCKMONSTERS)) mapmusflags |= MUSIC_RELOADRESET; if (line->flags & ML_NOTBOUNCY) mapmusflags |= MUSIC_FORCERESET; @@ -2393,7 +2393,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) } } - // Except, you can use the ML_BLOCKPLAYERS flag to change this behavior. + // Except, you can use the ML_BLOCKMONSTERS flag to change this behavior. // if (mapmusflags & MUSIC_RELOADRESET) then it will reset the music in G_PlayerReborn. } break; @@ -2482,7 +2482,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_BLOCKPLAYERS) + else if (line->flags & ML_BLOCKMONSTERS) { // play the sound from calling sector's soundorg if (callsec) @@ -3100,7 +3100,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) { foundrover = true; - if (line->flags & ML_BLOCKPLAYERS) // FOF flags determine respawn ability instead? + if (line->flags & ML_BLOCKMONSTERS) // FOF flags determine respawn ability instead? respawn = !(rover->flags & FF_NORETURN) ^ !!(line->flags & ML_NOCLIMB); // no climb inverts EV_StartCrumble(rover->master->frontsector, rover, (rover->flags & FF_FLOATBOB), player, rover->alpha, respawn); @@ -3188,7 +3188,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) INT32 viewid = sides[line->sidenum[0]].textureoffset>>FRACBITS; INT32 centerid = sides[line->sidenum[0]].rowoffset>>FRACBITS; - if ((line->flags & (ML_EFFECT4|ML_BLOCKPLAYERS)) == ML_EFFECT4) // Solid Midtexture is on but Block Enemies is off? + if ((line->flags & (ML_EFFECT4|ML_BLOCKMONSTERS)) == ML_EFFECT4) // Solid Midtexture is on but Block Enemies is off? { CONS_Alert(CONS_WARNING, M_GetText("Skybox switch linedef (tag %d) doesn't have anything to do.\nConsider changing the linedef's flag configuration or removing it entirely.\n"), @@ -3228,7 +3228,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) viewid, centerid, ((line->flags & ML_EFFECT4) ? "no" : "yes"), - ((line->flags & ML_BLOCKPLAYERS) ? "yes" : "no")); + ((line->flags & ML_BLOCKMONSTERS) ? "yes" : "no")); } break; @@ -3379,7 +3379,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) speed, (line->flags & ML_EFFECT4), // tic-based logic (line->flags & ML_EFFECT3), // Relative destvalue - !(line->flags & ML_BLOCKPLAYERS), // do not handle FF_EXISTS + !(line->flags & ML_BLOCKMONSTERS), // do not handle FF_EXISTS !(line->flags & ML_NOCLIMB), // do not handle FF_TRANSLUCENT !(line->flags & ML_EFFECT2), // do not handle lighting !(line->flags & ML_EFFECT2), // do not handle colormap (ran out of flags) @@ -3404,7 +3404,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) max(1, min(256, (line->flags & ML_EFFECT3) ? rover->alpha + destvalue : destvalue)), 0, // set alpha immediately false, NULL, // tic-based logic - !(line->flags & ML_BLOCKPLAYERS), // do not handle FF_EXISTS + !(line->flags & ML_BLOCKMONSTERS), // do not handle FF_EXISTS !(line->flags & ML_NOCLIMB), // do not handle FF_TRANSLUCENT !(line->flags & ML_EFFECT2), // do not handle lighting !(line->flags & ML_EFFECT2), // do not handle colormap (ran out of flags) @@ -3450,7 +3450,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) foundrover = true; P_ResetFakeFloorFader(rover, NULL, - !(line->flags & ML_BLOCKPLAYERS)); // do not finalize collision flags + !(line->flags & ML_BLOCKMONSTERS)); // do not finalize collision flags } } @@ -3611,7 +3611,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) INT32 pagenum = max(0, (sides[line->sidenum[0]].rowoffset>>FRACBITS)-1); INT32 postexectag = abs((line->sidenum[1] != 0xFFFF) ? sides[line->sidenum[1]].textureoffset>>FRACBITS : tag); - boolean closetextprompt = (line->flags & ML_BLOCKPLAYERS); + boolean closetextprompt = (line->flags & ML_BLOCKMONSTERS); //boolean allplayers = (line->flags & ML_NOCLIMB); boolean runpostexec = (line->flags & ML_EFFECT1); boolean blockcontrols = !(line->flags & ML_EFFECT2); @@ -6284,7 +6284,7 @@ void P_SpawnSpecials(boolean fromnetsave) break; case 64: // Appearing/Disappearing FOF option - if (lines[i].flags & ML_BLOCKPLAYERS) { // Find FOFs by control sector tag + if (lines[i].flags & ML_BLOCKMONSTERS) { // Find FOFs by control sector tag TAG_ITER_SECTORS(tag, s) for (j = 0; (unsigned)j < sectors[s].linecount; j++) if (sectors[s].lines[j]->special >= 100 && sectors[s].lines[j]->special < 300) @@ -6612,7 +6612,7 @@ void P_SpawnSpecials(boolean fromnetsave) ffloorflags |= FF_NOSHADE; P_AddFakeFloorsByLine(i, ffloorflags, secthinkers); - P_AddRaiseThinker(lines[i].frontsector, tag, speed, ceilingtop, ceilingbottom, !!(lines[i].flags & ML_BLOCKPLAYERS)); + P_AddRaiseThinker(lines[i].frontsector, tag, speed, ceilingtop, ceilingbottom, !!(lines[i].flags & ML_BLOCKMONSTERS)); break; }