From 45f79e4d42e00d695c922023c897c17c0ff594c3 Mon Sep 17 00:00:00 2001
From: Mario <zacjardine@y7mail.com>
Date: Sun, 16 Sep 2018 09:57:09 +1000
Subject: [PATCH] Add an extra option to wallclipping to not need downward
 velocity

---
 qcsrc/common/physics/movetypes/walk.qc | 2 +-
 qcsrc/common/stats.qh                  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/qcsrc/common/physics/movetypes/walk.qc b/qcsrc/common/physics/movetypes/walk.qc
index 8ac251618..6e4c548d6 100644
--- a/qcsrc/common/physics/movetypes/walk.qc
+++ b/qcsrc/common/physics/movetypes/walk.qc
@@ -53,7 +53,7 @@ void _Movetype_Physics_Walk(entity this, float dt)  // SV_WalkMove
 	// if the move did not hit the ground at any point, we're not on ground
 	if (!(clip & 1))
 		UNSET_ONGROUND(this);
-	else if(PHYS_WALLCLIP(this) && !this.groundentity && start_velocity.z < -200) // don't do landing time if we were just going down a slope
+	else if(PHYS_WALLCLIP(this) && !this.groundentity && (PHYS_WALLCLIP(this) == 2 || start_velocity.z < -200)) // don't do landing time if we were just going down a slope
 		this.pm_time = 0.25;
 
 	_Movetype_CheckVelocity(this);
diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh
index 91548ccdf..cf51ea66b 100644
--- a/qcsrc/common/stats.qh
+++ b/qcsrc/common/stats.qh
@@ -366,9 +366,9 @@ REGISTER_STAT(MOVEVARS_AIRACCEL_QW, float)
 REGISTER_STAT(MOVEVARS_AIRACCEL_SIDEWAYS_FRICTION, float)
 REGISTER_STAT(MOVEVARS_SPECIALCOMMAND, bool)
 #ifdef SVQC
-bool autocvar_sv_wallclip;
+int autocvar_sv_wallclip;
 #endif
-REGISTER_STAT(MOVEVARS_WALLCLIP, bool, autocvar_sv_wallclip)
+REGISTER_STAT(MOVEVARS_WALLCLIP, int, autocvar_sv_wallclip)
 
 
 #ifdef CSQC
-- 
2.39.5