From c47eb0b324fd738238594fda4109b7f6afe56346 Mon Sep 17 00:00:00 2001 From: vortex Date: Sun, 17 Oct 2010 19:23:27 +0000 Subject: [PATCH] add sv_gameplayfix_nostepmoveonsteepslopes which prevents MOVETYPE_STEP monsters (no FL_SWIM or FL_FLY ones) from walking very steep slopes git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10544 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=30e5596cd568470a914064ee95df1428feccf2f7 --- server.h | 1 + sv_main.c | 2 ++ sv_move.c | 10 ++++++++++ 3 files changed, 13 insertions(+) diff --git a/server.h b/server.h index c9da9a8c..82134445 100644 --- 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_nostepmoveonsteepslopes; extern cvar_t sv_gameplayfix_swiminbmodels; extern cvar_t sv_gameplayfix_upwardvelocityclearsongroundflag; extern cvar_t sv_gameplayfix_downtracesupportsongroundflag; diff --git a/sv_main.c b/sv_main.c index af4e5be1..9d1080a5 100644 --- 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_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)"}; @@ -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_nostepmoveonsteepslopes); Cvar_RegisterVariable (&sv_gameplayfix_swiminbmodels); Cvar_RegisterVariable (&sv_gameplayfix_upwardvelocityclearsongroundflag); Cvar_RegisterVariable (&sv_gameplayfix_downtracesupportsongroundflag); diff --git a/sv_move.c b/sv_move.c index 507f51c3..f8a1cfb6 100644 --- 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; +// 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 -- 2.39.2