added sv_gameplayfix_grenadebouncedownsteps, sv_gameplayfix_noairborncorpse, sv_gamep...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 22 May 2004 02:59:36 +0000 (02:59 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 22 May 2004 02:59:36 +0000 (02:59 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4233 d7cf8633-e32d-0410-b094-e92efae38249

server.h
sv_main.c
sv_phys.c
world.c

index 5ae03a2..d7cfd72 100644 (file)
--- a/server.h
+++ b/server.h
@@ -257,6 +257,11 @@ extern cvar_t sv_aim;
 extern cvar_t sv_stepheight;
 extern cvar_t sv_jumpstep;
 
+extern cvar_t sv_gameplayfix_grenadebouncedownslopes;
+extern cvar_t sv_gameplayfix_noairborncorpse;
+extern cvar_t sv_gameplayfix_stepwhilejumping;
+extern cvar_t sv_gameplayfix_swiminbmodels;
+
 extern mempool_t *sv_clients_mempool;
 extern mempool_t *sv_edicts_mempool;
 
index 051a8ec..4b4ac37 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -26,6 +26,11 @@ static cvar_t sv_cullentities_trace = {0, "sv_cullentities_trace", "0"}; // tend
 static cvar_t sv_cullentities_stats = {0, "sv_cullentities_stats", "0"};
 static cvar_t sv_entpatch = {0, "sv_entpatch", "1"};
 
+cvar_t sv_gameplayfix_grenadebouncedownslopes = {0, "sv_gameplayfix_grenadebouncedownslopes", "1"};
+cvar_t sv_gameplayfix_noairborncorpse = {0, "sv_gameplayfix_noairborncorpse", "1"};
+cvar_t sv_gameplayfix_stepwhilejumping = {0, "sv_gameplayfix_stepwhilejumping", "1"};
+cvar_t sv_gameplayfix_swiminbmodels = {0, "sv_gameplayfix_swiminbmodels", "1"};
+
 server_t sv;
 server_static_t svs;
 
@@ -64,6 +69,10 @@ void SV_Init (void)
        Cvar_RegisterVariable (&sv_cullentities_trace);
        Cvar_RegisterVariable (&sv_cullentities_stats);
        Cvar_RegisterVariable (&sv_entpatch);
+       Cvar_RegisterVariable (&sv_gameplayfix_grenadebouncedownslopes);
+       Cvar_RegisterVariable (&sv_gameplayfix_noairborncorpse);
+       Cvar_RegisterVariable (&sv_gameplayfix_stepwhilejumping);
+       Cvar_RegisterVariable (&sv_gameplayfix_swiminbmodels);
 
        SV_Phys_Init();
        SV_World_Init();
index 74b254b..909dbb4 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -1014,7 +1014,7 @@ void SV_WalkMove (edict_t *ent)
 
        if (ent->v->movetype != MOVETYPE_FLY)
        {
-               if (!oldonground && ent->v->waterlevel == 0 && !sv_jumpstep.integer)
+               if (!oldonground && ent->v->waterlevel == 0 && (!sv_jumpstep.integer || !sv_gameplayfix_stepwhilejumping.integer))
                        // don't stair up while jumping
                        return;
 
@@ -1205,6 +1205,8 @@ void SV_Physics_Toss (edict_t *ent)
 // if onground, return without moving
        if ((int)ent->v->flags & FL_ONGROUND)
        {
+               if (!sv_gameplayfix_noairborncorpse.integer)
+                       return;
                if (ent->v->groundentity == 0)
                        return;
                // if ent was supported by a brush model on previous frame,
@@ -1252,16 +1254,31 @@ void SV_Physics_Toss (edict_t *ent)
                        float d;
                        ClipVelocity (ent->v->velocity, trace.plane.normal, ent->v->velocity, 1.5);
                        // LordHavoc: fixed grenades not bouncing when fired down a slope
-                       d = DotProduct(trace.plane.normal, ent->v->velocity);
-                       if (trace.plane.normal[2] > 0.7 && fabs(d) < 60)
+                       if (sv_gameplayfix_grenadebouncedownslopes.integer)
                        {
-                               ent->v->flags = (int)ent->v->flags | FL_ONGROUND;
-                               ent->v->groundentity = EDICT_TO_PROG(trace.ent);
-                               VectorClear (ent->v->velocity);
-                               VectorClear (ent->v->avelocity);
+                               d = DotProduct(trace.plane.normal, ent->v->velocity);
+                               if (trace.plane.normal[2] > 0.7 && fabs(d) < 60)
+                               {
+                                       ent->v->flags = (int)ent->v->flags | FL_ONGROUND;
+                                       ent->v->groundentity = EDICT_TO_PROG(trace.ent);
+                                       VectorClear (ent->v->velocity);
+                                       VectorClear (ent->v->avelocity);
+                               }
+                               else
+                                       ent->v->flags = (int)ent->v->flags & ~FL_ONGROUND;
                        }
                        else
-                               ent->v->flags = (int)ent->v->flags & ~FL_ONGROUND;
+                       {
+                               if (trace.plane.normal[2] > 0.7 && ent->v->velocity[2] < 60)
+                               {
+                                       ent->v->flags = (int)ent->v->flags | FL_ONGROUND;
+                                       ent->v->groundentity = EDICT_TO_PROG(trace.ent);
+                                       VectorClear (ent->v->velocity);
+                                       VectorClear (ent->v->avelocity);
+                               }
+                               else
+                                       ent->v->flags = (int)ent->v->flags & ~FL_ONGROUND;
+                       }
                }
                else
                {
diff --git a/world.c b/world.c
index 1d6763d..1945d90 100644 (file)
--- a/world.c
+++ b/world.c
@@ -727,7 +727,7 @@ trace_t SV_Move(const vec3_t start, const vec3_t mins, const vec3_t maxs, const
 
 int SV_PointSuperContents(const vec3_t point)
 {
-       return SV_Move(point, vec3_origin, vec3_origin, point, MOVE_NOMONSTERS, NULL).startsupercontents;
+       return SV_Move(point, vec3_origin, vec3_origin, point, sv_gameplayfix_swiminbmodels.integer ? MOVE_NOMONSTERS : MOVE_WORLDONLY, NULL).startsupercontents;
 }
 
 int SV_PointQ1Contents(const vec3_t point)