]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_phys.c
fixed 'slow gravity' bug when cl_movement players are not replying to all server...
[xonotic/darkplaces.git] / sv_phys.c
index 895e6876a9d1ef12179624abdb243757c27881e3..725aa884e89ca78fa9ee752807e466e1405f6953 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -42,6 +42,7 @@ solid_edge items only clip against bsp models.
 */
 
 cvar_t sv_friction = {CVAR_NOTIFY, "sv_friction","4", "how fast you slow down"};
+cvar_t sv_waterfriction = {CVAR_NOTIFY, "sv_waterfriction","-1", "how fast you slow down, if less than 0 the sv_friction variable is used instead"};
 cvar_t sv_stopspeed = {CVAR_NOTIFY, "sv_stopspeed","100", "how fast you come to a complete stop"};
 cvar_t sv_gravity = {CVAR_NOTIFY, "sv_gravity","800", "how fast you fall (512 = roughly earth gravity)"};
 cvar_t sv_maxvelocity = {CVAR_NOTIFY, "sv_maxvelocity","2000", "universal speed limit on all entities"};
@@ -56,6 +57,9 @@ cvar_t sv_playerphysicsqc = {CVAR_NOTIFY, "sv_playerphysicsqc", "1", "enables Qu
 cvar_t sv_sound_watersplash = {0, "sv_sound_watersplash", "misc/h2ohit1.wav", "sound to play when MOVETYPE_FLY/TOSS/BOUNCE/STEP entity enters or leaves water (empty cvar disables the sound)"};
 cvar_t sv_sound_land = {0, "sv_sound_land", "demon/dland2.wav", "sound to play when MOVETYPE_STEP entity hits the ground at high speed (empty cvar disables the sound)"};
 
+// TODO: move this extern to server.h
+extern cvar_t sv_clmovement_waitforinput;
+
 #define        MOVE_EPSILON    0.01
 
 void SV_Physics_Toss (prvm_edict_t *ent);
@@ -525,6 +529,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;
 }
 
@@ -1663,7 +1671,9 @@ void SV_Physics (void)
                        if (!host_client->spawned)
                                memset(&host_client->cmd, 0, sizeof(host_client->cmd));
                        // don't run physics here if running asynchronously
-                       else if (!host_client->movesequence)
+                       else if (host_client->clmovement_skipphysicsframes > 0)
+                               host_client->clmovement_skipphysicsframes--;
+                       else
                                SV_Physics_ClientEntity(ent);
                }
        }