]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
add sv_gameplayfix_nostepmoveonsteepslopes which prevents MOVETYPE_STEP monsters...
authorvortex <vortex@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 17 Oct 2010 19:23:27 +0000 (19:23 +0000)
committervortex <vortex@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 17 Oct 2010 19:23:27 +0000 (19:23 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10544 d7cf8633-e32d-0410-b094-e92efae38249

server.h
sv_main.c
sv_move.c

index c9da9a8c765597059212e6a35f744fb5d4f3c02c..8213444528b24f4ab7608131e1f0e01ca99344da 100644 (file)
--- a/server.h
+++ b/server.h
@@ -442,6 +442,7 @@ extern cvar_t sv_gameplayfix_slidemoveprojectiles;
 extern cvar_t sv_gameplayfix_stepdown;
 extern cvar_t sv_gameplayfix_stepwhilejumping;
 extern cvar_t sv_gameplayfix_stepmultipletimes;
 extern cvar_t sv_gameplayfix_stepdown;
 extern cvar_t sv_gameplayfix_stepwhilejumping;
 extern cvar_t sv_gameplayfix_stepmultipletimes;
+extern cvar_t sv_gameplayfix_nostepmoveonsteepslopes;
 extern cvar_t sv_gameplayfix_swiminbmodels;
 extern cvar_t sv_gameplayfix_upwardvelocityclearsongroundflag;
 extern cvar_t sv_gameplayfix_downtracesupportsongroundflag;
 extern cvar_t sv_gameplayfix_swiminbmodels;
 extern cvar_t sv_gameplayfix_upwardvelocityclearsongroundflag;
 extern cvar_t sv_gameplayfix_downtracesupportsongroundflag;
index 7a2a31cd2c186fadfde12b04e79f3f079fa56e06..1e59da0861d687b7b764e8c149b4008f1bcd77db 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -115,6 +115,7 @@ cvar_t sv_gameplayfix_slidemoveprojectiles = {0, "sv_gameplayfix_slidemoveprojec
 cvar_t sv_gameplayfix_stepdown = {0, "sv_gameplayfix_stepdown", "0", "attempts to step down stairs, not just up them (prevents the familiar thud..thud..thud.. when running down stairs and slopes)"};
 cvar_t sv_gameplayfix_stepwhilejumping = {0, "sv_gameplayfix_stepwhilejumping", "1", "applies step-up onto a ledge even while airborn, useful if you would otherwise just-miss the floor when running across small areas with gaps (for instance running across the moving platforms in dm2, or jumping to the megahealth and red armor in dm2 rather than using the bridge)"};
 cvar_t sv_gameplayfix_stepmultipletimes = {0, "sv_gameplayfix_stepmultipletimes", "0", "applies step-up onto a ledge more than once in a single frame, when running quickly up stairs"};
 cvar_t sv_gameplayfix_stepdown = {0, "sv_gameplayfix_stepdown", "0", "attempts to step down stairs, not just up them (prevents the familiar thud..thud..thud.. when running down stairs and slopes)"};
 cvar_t sv_gameplayfix_stepwhilejumping = {0, "sv_gameplayfix_stepwhilejumping", "1", "applies step-up onto a ledge even while airborn, useful if you would otherwise just-miss the floor when running across small areas with gaps (for instance running across the moving platforms in dm2, or jumping to the megahealth and red armor in dm2 rather than using the bridge)"};
 cvar_t sv_gameplayfix_stepmultipletimes = {0, "sv_gameplayfix_stepmultipletimes", "0", "applies step-up onto a ledge more than once in a single frame, when running quickly up stairs"};
+cvar_t sv_gameplayfix_nostepmoveonsteepslopes = {0, "sv_gameplayfix_nostepmoveonsteepslopes", "0", "grude fix which prevents MOVETYPE_STEP (not swimming or flying) to move on slopes whose angle is bigger than 45 degree"};
 cvar_t sv_gameplayfix_swiminbmodels = {0, "sv_gameplayfix_swiminbmodels", "1", "causes pointcontents (used to determine if you are in a liquid) to check bmodel entities as well as the world model, so you can swim around in (possibly moving) water bmodel entities"};
 cvar_t sv_gameplayfix_upwardvelocityclearsongroundflag = {0, "sv_gameplayfix_upwardvelocityclearsongroundflag", "1", "prevents monsters, items, and most other objects from being stuck to the floor when pushed around by damage, and other situations in mods"};
 cvar_t sv_gameplayfix_downtracesupportsongroundflag = {0, "sv_gameplayfix_downtracesupportsongroundflag", "1", "prevents very short moves from clearing onground (which may make the player stick to the floor at high netfps)"};
 cvar_t sv_gameplayfix_swiminbmodels = {0, "sv_gameplayfix_swiminbmodels", "1", "causes pointcontents (used to determine if you are in a liquid) to check bmodel entities as well as the world model, so you can swim around in (possibly moving) water bmodel entities"};
 cvar_t sv_gameplayfix_upwardvelocityclearsongroundflag = {0, "sv_gameplayfix_upwardvelocityclearsongroundflag", "1", "prevents monsters, items, and most other objects from being stuck to the floor when pushed around by damage, and other situations in mods"};
 cvar_t sv_gameplayfix_downtracesupportsongroundflag = {0, "sv_gameplayfix_downtracesupportsongroundflag", "1", "prevents very short moves from clearing onground (which may make the player stick to the floor at high netfps)"};
@@ -439,6 +440,7 @@ void SV_Init (void)
        Cvar_RegisterVariable (&sv_gameplayfix_stepdown);
        Cvar_RegisterVariable (&sv_gameplayfix_stepwhilejumping);
        Cvar_RegisterVariable (&sv_gameplayfix_stepmultipletimes);
        Cvar_RegisterVariable (&sv_gameplayfix_stepdown);
        Cvar_RegisterVariable (&sv_gameplayfix_stepwhilejumping);
        Cvar_RegisterVariable (&sv_gameplayfix_stepmultipletimes);
+       Cvar_RegisterVariable (&sv_gameplayfix_nostepmoveonsteepslopes);
        Cvar_RegisterVariable (&sv_gameplayfix_swiminbmodels);
        Cvar_RegisterVariable (&sv_gameplayfix_upwardvelocityclearsongroundflag);
        Cvar_RegisterVariable (&sv_gameplayfix_downtracesupportsongroundflag);
        Cvar_RegisterVariable (&sv_gameplayfix_swiminbmodels);
        Cvar_RegisterVariable (&sv_gameplayfix_upwardvelocityclearsongroundflag);
        Cvar_RegisterVariable (&sv_gameplayfix_downtracesupportsongroundflag);
index 507f51c3aefabd2624b86e64ab7d7548eb0423c7..f8a1cfb6cabe0da5e392ae062a7f850f4fe0d007 100644 (file)
--- a/sv_move.c
+++ b/sv_move.c
@@ -216,6 +216,16 @@ qboolean SV_movestep (prvm_edict_t *ent, vec3_t move, qboolean relink, qboolean
        if ( (int)ent->fields.server->flags & FL_PARTIALGROUND )
                ent->fields.server->flags = (int)ent->fields.server->flags & ~FL_PARTIALGROUND;
 
        if ( (int)ent->fields.server->flags & FL_PARTIALGROUND )
                ent->fields.server->flags = (int)ent->fields.server->flags & ~FL_PARTIALGROUND;
 
+// gameplayfix: check if reached pretty steep plane and bail
+       if ( ! ( (int)ent->fields.server->flags & (FL_SWIM | FL_FLY) ) && sv_gameplayfix_nostepmoveonsteepslopes.integer )
+       {
+               if (trace.plane.normal[ 2 ] < 0.5)
+               {
+                       VectorCopy (oldorg, ent->fields.server->origin);
+                       return false;
+               }
+       }
+
        ent->fields.server->groundentity = PRVM_EDICT_TO_PROG(trace.ent);
 
 // the move is ok
        ent->fields.server->groundentity = PRVM_EDICT_TO_PROG(trace.ent);
 
 // the move is ok