]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
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 5ae03a239c6c8831b2c199cf20d0d469413511f5..d7cfd72751feaafd981d85f74b80824312d5119a 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_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;
 
 extern mempool_t *sv_clients_mempool;
 extern mempool_t *sv_edicts_mempool;
 
index 051a8ec2a6d71d7ef3fec60796707d7ba983d0e6..4b4ac374400738b63d6d222b0c2a3edf649497b6 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"};
 
 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;
 
 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_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();
 
        SV_Phys_Init();
        SV_World_Init();
index 74b254b8425a704d26e6fc3a2a341a58d4e05860..909dbb4cbfc8c38e51c0fa6de53a9d3a9d1a9896 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 (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;
 
                        // 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 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,
                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
                        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
                        }
                        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
                {
                }
                else
                {
diff --git a/world.c b/world.c
index 1d6763d9672af23d4635b9bc1d09101790277a17..1945d9066905546373c094a5c0e9d13909ece83e 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)
 {
 
 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)
 }
 
 int SV_PointQ1Contents(const vec3_t point)