From 2f968a2d754a4aa615e263d154b57ef1b91bda3c Mon Sep 17 00:00:00 2001 From: havoc Date: Fri, 26 May 2006 01:00:09 +0000 Subject: [PATCH] implemented sv_gameplayfix_qwplayerphysics git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6391 d7cf8633-e32d-0410-b094-e92efae38249 --- server.h | 1 + sv_main.c | 2 ++ sv_phys.c | 4 ++++ sv_user.c | 2 +- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/server.h b/server.h index bc6eb4f8..c403d060 100644 --- 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; diff --git a/sv_main.c b/sv_main.c index b7b71edf..9463489c 100644 --- 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); diff --git a/sv_phys.c b/sv_phys.c index 2355d16b..1f50232b 100644 --- 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; } diff --git a/sv_user.c b/sv_user.c index 4d53cfab..bf13b1f8 100644 --- 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 (); -- 2.39.2