From 9880a03bb1aa5990be5f3bbcd6382ed533b449d4 Mon Sep 17 00:00:00 2001 From: cypress Date: Tue, 4 Jun 2024 20:12:35 -0700 Subject: [PATCH] SERVER: Mitigate horizontal/sideways sprinting --- source/server/weapons/weapon_core.qc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/server/weapons/weapon_core.qc b/source/server/weapons/weapon_core.qc index e4ec71a..3125ad3 100644 --- a/source/server/weapons/weapon_core.qc +++ b/source/server/weapons/weapon_core.qc @@ -1668,6 +1668,8 @@ void() CheckPlayer = CheckRevive(self); if (self.sprinting) { + makevectors(self.angles); + // We should stop sprinting if we are falling, technically // CoD continues the animation but applies a move speed // penalty, however, that makes no sense! This also applies @@ -1680,6 +1682,11 @@ void() CheckPlayer = // you're applying less pressure to the analog stick. else if (vlen(self.velocity) <= 130 && self.sprint_delay <= time + 0.75) W_SprintStop(); + // Another sprinting caveat -- if we are moving a considerabe distance + // horizontally, much more than reasonable, it is very obviously impossible + // to actually sprint. + else if (fabs(self.velocity * v_right) >= fabs(self.velocity * v_forward) * 0.75) + W_SprintStop(); } // FIXME - can't do frame independent stance changing.. ofs starts spazzing..