diff --git a/doc/specs/udmf_srb2.txt b/doc/specs/udmf_srb2.txt index c758d7e40f13d466afcfc689c679845fec71b906..b25ed1af38ee55b6c2ecf568c824520d800c58e7 100644 --- a/doc/specs/udmf_srb2.txt +++ b/doc/specs/udmf_srb2.txt @@ -228,6 +228,8 @@ Sonic Robo Blast 2 defines the following standardized fields: ropehang = <bool>; // Sector is a rope hang. Must be applied to a 3D floor. jumpflip = <bool>; // Sector flips the gravity of players who jump from it. gravityoverride = <bool>; // Reverse gravity effect is only applied when an object is in the sector. + nophysics_floor = <bool>; // Disables floor slope physics if created through a plane equation. + nophysics_ceiling = <bool>; // Disables ceiling slope physics if created through a plane equation. friction = <float>; // Sector's friction factor. gravity = <float>; // Sector's gravity. Default is 1.0. diff --git a/extras/conf/udb/Includes/SRB222_misc.cfg b/extras/conf/udb/Includes/SRB222_misc.cfg index 405d043c140995b4ed840528878cc6eda7c53346..0b94a5a87a37a5ce7cf6a2a4c9e5799f7c738eab 100644 --- a/extras/conf/udb/Includes/SRB222_misc.cfg +++ b/extras/conf/udb/Includes/SRB222_misc.cfg @@ -78,6 +78,8 @@ sectorflags ropehang = "Rope Hang"; jumpflip = "Flip Gravity on Jump"; gravityoverride = "Make Reverse Gravity Temporary"; + nophysics_floor = "Disable Floor Slope Physics"; + nophysics_ceiling = "Disable Ceiling Slope Physics"; flipspecial_nofloor = "No Trigger on Floor Touch"; flipspecial_ceiling = "Trigger on Ceiling Touch"; triggerspecial_touch = "Trigger on Edge Touch"; @@ -114,6 +116,8 @@ sectorflagscategories ropehang = "special"; jumpflip = "special"; gravityoverride = "special"; + nophysics_floor = "special"; + nophysics_ceiling = "special"; flipspecial_nofloor = "trigger"; flipspecial_ceiling = "trigger"; triggerspecial_touch = "trigger"; diff --git a/src/p_setup.c b/src/p_setup.c index beab864d3bcb45ebff12b92728f20971221217f5..41487d702f265c7e5164c61be8d0b8f8c059aa38 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -1859,6 +1859,10 @@ static void ParseTextmapSectorParameter(UINT32 i, const char *param, const char sectors[i].specialflags |= SSF_JUMPFLIP; else if (fastcmp(param, "gravityoverride") && fastcmp("true", val)) sectors[i].specialflags |= SSF_GRAVITYOVERRIDE; + else if (fastcmp(param, "nophysics_floor") && fastcmp("true", val)) + sectors[i].specialflags |= SSF_NOPHYSICSFLOOR; + else if (fastcmp(param, "nophysics_ceiling") && fastcmp("true", val)) + sectors[i].specialflags |= SSF_NOPHYSICSCEILING; else if (fastcmp(param, "friction")) sectors[i].friction = FLOAT_TO_FIXED(atof(val)); else if (fastcmp(param, "gravity")) @@ -3012,13 +3016,17 @@ static void P_LoadTextmap(void) { sc->f_slope = P_MakeSlopeViaEquationConstants(textmap_planefloor.a, textmap_planefloor.b, textmap_planefloor.c, textmap_planefloor.d); sc->hasslope = true; + if (sc->specialflags & SSF_NOPHYSICSFLOOR) + sc->f_slope->flags |= SL_NOPHYSICS; } if (textmap_planeceiling.defined == (PD_A|PD_B|PD_C|PD_D)) { sc->c_slope = P_MakeSlopeViaEquationConstants(textmap_planeceiling.a, textmap_planeceiling.b, textmap_planeceiling.c, textmap_planeceiling.d); sc->hasslope = true; - } + if (sc->specialflags & SSF_NOPHYSICSCEILING) + sc->c_slope->flags |= SL_NOPHYSICS; + } TextmapFixFlatOffsets(sc); } diff --git a/src/r_defs.h b/src/r_defs.h index 7e92c92492a88527f2bf5685bf93797c0081494c..cb94dd6e5a5641970b216e88ce9183d66d186e63 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -405,6 +405,8 @@ typedef enum SSF_ROPEHANG = 1<<18, SSF_JUMPFLIP = 1<<19, SSF_GRAVITYOVERRIDE = 1<<20, // combine with MSF_GRAVITYFLIP + SSF_NOPHYSICSFLOOR = 1<<21, + SSF_NOPHYSICSCEILING = 1<<22, } sectorspecialflags_t; typedef enum