diff --git a/src/m_menu.c b/src/m_menu.c index 5a68830d..57b9baa5 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -3864,6 +3864,7 @@ enum { general_end5, general_title6, + general_hangsolid, general_blockmapfix, general_pistolstart, general_end6, @@ -4044,6 +4045,9 @@ setup_menu_t gen_settings3[] = { // General Settings screen3 {"Compatibility-breaking Features" ,S_SKIP|S_TITLE, m_null, M_X, M_Y + general_title6*M_SPC}, + {"Walk Under Solid Hanging Bodies", S_YESNO, m_null, M_X, + M_Y + general_hangsolid*M_SPC, {"hangsolid"}}, + {"Improved Hit Detection", S_YESNO, m_null, M_X, M_Y + general_blockmapfix*M_SPC, {"blockmapfix"}}, @@ -6950,6 +6954,8 @@ void M_ResetSetupMenu(void) void M_UpdateCriticalItems(void) { + DISABLE_CRITICAL(gen_settings3[general_hangsolid]); + if (demo_compatibility && overflow[emu_intercepts].enabled) gen_settings3[general_blockmapfix].m_flags |= S_DISABLE; else diff --git a/src/m_misc.c b/src/m_misc.c index d4174819..666b86e5 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -105,6 +105,7 @@ extern boolean r_swirl; extern int death_use_action; extern boolean palette_changes; extern boolean screen_melt; +extern boolean hangsolid; extern boolean blockmapfix; extern int extra_level_brightness; extern int menu_background; @@ -463,6 +464,13 @@ default_t defaults[] = { "1 to enable \"ghost monsters\" (resurrected pools of gore are translucent)" }, + { + "hangsolid", + (config_t *) &hangsolid, NULL, + {0}, {0,1}, number, ss_enem, wad_no, + "1 to walk under solid hanging bodies" + }, + { "blockmapfix", (config_t *) &blockmapfix, NULL, diff --git a/src/p_map.c b/src/p_map.c index 63ccbd7d..6cb29586 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -477,6 +477,8 @@ static boolean PIT_CheckLine(line_t *ld) // killough 3/26/98: make static // PIT_CheckThing // +boolean hangsolid; + // mbf21: dehacked projectile groups static boolean P_ProjectileImmune(mobj_t *target, mobj_t *source) { @@ -645,6 +647,19 @@ static boolean PIT_CheckThing(mobj_t *thing) // killough 3/26/98: make static return !solid; } + // RjY + // comperr_hangsolid, an attempt to handle blocking hanging bodies + // A solid hanging body will allow sufficiently small things underneath it. + if (CRITICAL(hangsolid) && + !((~thing->flags) & (MF_SOLID | MF_SPAWNCEILING)) // solid and hanging + // invert everything, then both bits should be clear + && tmthing->z + tmthing->height <= thing->z) // head height <= base + // top of thing trying to move under the body <= bottom of body + { + tmceilingz = thing->z; // pretend ceiling height is at body's base + return true; + } + // killough 3/16/98: Allow non-solid moving objects to move through solid // ones, by allowing the moving thing (tmthing) to move if it's non-solid, // despite another solid thing being in the way.