From c0f47949ec8893f0f41c7d647fcdbde4d6279c99 Mon Sep 17 00:00:00 2001 From: s1lentq Date: Fri, 12 Jan 2024 09:27:40 +0700 Subject: [PATCH] PM_CategorizePosition: Do not stick to the ground of an OBSERVER or NOCLIP mode --- regamedll/pm_shared/pm_shared.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/regamedll/pm_shared/pm_shared.cpp b/regamedll/pm_shared/pm_shared.cpp index b41a2392..e0a57eb2 100644 --- a/regamedll/pm_shared/pm_shared.cpp +++ b/regamedll/pm_shared/pm_shared.cpp @@ -1436,6 +1436,13 @@ void PM_CategorizePosition() // water on each call, and the converse case will correct itself if called twice. PM_CheckWater(); + // Do not stick to the ground of an OBSERVER or NOCLIP mode + if (pmove->movetype == MOVETYPE_NOCLIP || pmove->movetype == MOVETYPE_NONE) + { + pmove->onground = -1; + return; + } + point[0] = pmove->origin[0]; point[1] = pmove->origin[1]; point[2] = pmove->origin[2] - 2; @@ -3275,7 +3282,7 @@ void EXT_FUNC __API_HOOK(PM_Move)(struct playermove_s *ppmove, int server) DbgAssert(pm_shared_initialized); pmove = ppmove; - + #ifdef REGAMEDLL_API pmoveplayer = UTIL_PlayerByIndex(pmove->player_index + 1)->CSPlayer(); #endif