]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
implemented sv_gameplayfix_qwplayerphysics
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 26 May 2006 01:00:09 +0000 (01:00 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 26 May 2006 01:00:09 +0000 (01:00 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6391 d7cf8633-e32d-0410-b094-e92efae38249

server.h
sv_main.c
sv_phys.c
sv_user.c

index bc6eb4f83a3d54ffc313cf0c0b6646ccae2528c6..c403d0608de1baf2a9f71b60d7ee4900d6d3ba15 100644 (file)
--- a/server.h
+++ b/server.h
@@ -269,6 +269,7 @@ extern cvar_t sv_gameplayfix_swiminbmodels;
 extern cvar_t sv_gameplayfix_setmodelrealbox;
 extern cvar_t sv_gameplayfix_blowupfallenzombies;
 extern cvar_t sv_gameplayfix_findradiusdistancetobox;
+extern cvar_t sv_gameplayfix_qwplayerphysics;
 
 extern cvar_t sys_ticrate;
 extern cvar_t sv_fixedframeratesingleplayer;
index b7b71edfca25fcf582c5bd4ada2078a1ebbafe41..9463489c32cfa152bfd134e0c1ffde4d064e1881 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -49,6 +49,7 @@ cvar_t sv_gameplayfix_swiminbmodels = {0, "sv_gameplayfix_swiminbmodels", "1", "
 cvar_t sv_gameplayfix_setmodelrealbox = {0, "sv_gameplayfix_setmodelrealbox", "1", "fixes a bug in Quake that made setmodel always set the entity box to ('-16 -16 -16', '16 16 16') rather than properly checking the model box, breaks some poorly coded mods"};
 cvar_t sv_gameplayfix_blowupfallenzombies = {0, "sv_gameplayfix_blowupfallenzombies", "1", "causes findradius to detect SOLID_NOT entities such as zombies and corpses on the floor, allowing splash damage to apply to them"};
 cvar_t sv_gameplayfix_findradiusdistancetobox = {0, "sv_gameplayfix_findradiusdistancetobox", "1", "causes findradius to check the distance to the corner of a box rather than the center of the box, makes findradius detect bmodels such as very large doors that would otherwise be unaffected by splash damage"};
+cvar_t sv_gameplayfix_qwplayerphysics = {0, "sv_gameplayfix_qwplayerphysics", "1", "changes water jumping to make it easier to get out of water, and prevents friction on landing when bunnyhopping"};
 
 cvar_t sv_progs = {0, "sv_progs", "progs.dat", "selects which quakec progs.dat file to run" };
 
@@ -97,6 +98,7 @@ void SV_Init (void)
        Cvar_RegisterVariable (&sv_gameplayfix_setmodelrealbox);
        Cvar_RegisterVariable (&sv_gameplayfix_blowupfallenzombies);
        Cvar_RegisterVariable (&sv_gameplayfix_findradiusdistancetobox);
+       Cvar_RegisterVariable (&sv_gameplayfix_qwplayerphysics);
        Cvar_RegisterVariable (&sv_protocolname);
        Cvar_RegisterVariable (&sv_ratelimitlocalplayer);
        Cvar_RegisterVariable (&sv_maxrate);
index 2355d16b7764716ebcee306df6993b647a2954f4..1f50232b80fda0ded1f1d8187be882de6619070c 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -526,6 +526,10 @@ int SV_FlyMove (prvm_edict_t *ent, float time, float *stepnormal)
                trace = SV_Move(ent->fields.server->origin, ent->fields.server->mins, ent->fields.server->maxs, end, MOVE_NORMAL, ent);
        }
        */
+
+       // LordHavoc: this came from QW and allows you to get out of water more easily
+       if (sv_gameplayfix_qwplayerphysics.integer && ((int)ent->fields.server->flags & FL_WATERJUMP))
+               VectorCopy(primal_velocity, ent->fields.server->velocity);
        return blocked;
 }
 
index 4d53cfab21973c9765a02d90be7e79e71dfbfb04..bf13b1f8e7b84acce82cb88fd5a59dda436918e5 100644 (file)
--- a/sv_user.c
+++ b/sv_user.c
@@ -355,7 +355,7 @@ void SV_AirMove (void)
                // noclip
                VectorCopy (wishvel, host_client->edict->fields.server->velocity);
        }
-       else if ( onground )
+       else if (onground && (!sv_gameplayfix_qwplayerphysics.integer || !(host_client->edict->fields.server->button2 || !((int)host_client->edict->fields.server->flags & FL_JUMPRELEASED))))
        {
                SV_UserFriction ();
                SV_Accelerate ();