From 4ce150518a016f760b3e3bfc7d7a90bee7331955 Mon Sep 17 00:00:00 2001 From: BenCat07 Date: Mon, 18 May 2020 11:04:05 +0200 Subject: [PATCH] Ignore "no jump" areas and improve jump logic --- src/navparser.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/navparser.cpp b/src/navparser.cpp index 1a74f1c6..92a9daf3 100644 --- a/src/navparser.cpp +++ b/src/navparser.cpp @@ -678,7 +678,10 @@ static void cm() // Detect when jumping is necessary if ((!(g_pLocalPlayer->holding_sniper_rifle && g_pLocalPlayer->bZoomed) && crumb_vec->z - g_pLocalPlayer->v_Origin.z > 18 && last_jump.test_and_set(200)) || (last_jump.test_and_set(200) && inactivity.check(*stuck_time / 2))) { - current_user_cmd->buttons |= IN_JUMP; + auto local = findClosestNavSquare(g_pLocalPlayer->v_Origin); + // Check if current area allows jumping + if (!local || !(local->m_attributeFlags & NAV_MESH_NO_JUMP)) + current_user_cmd->buttons |= (IN_JUMP | IN_DUCK); } // Walk to next crumb WalkTo(*crumb_vec);