From 00f4add81e4ef3194501adbe0ec96ddaf2bb8125 Mon Sep 17 00:00:00 2001 From: Vftdan Date: Fri, 13 Oct 2023 15:15:40 +0300 Subject: [PATCH] wallhack: fix sign of pitch to vector conversion --- augment/modules/wh.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/augment/modules/wh.lua b/augment/modules/wh.lua index 938be91..eb78066 100644 --- a/augment/modules/wh.lua +++ b/augment/modules/wh.lua @@ -2,15 +2,18 @@ return function() local playerLookVector = nil local function updateLookVector() - -- pitch: + -- yaw: -- 0 => positive Z -- 90 => negative X + -- pitch: + -- 0 => forward + -- 90 => down local yawr = math.rad(player.yaw) local pitchr = math.rad(player.pitch) local cosPitch = math.cos(pitchr) local x = cosPitch * -math.sin(yawr) local z = cosPitch * math.cos(yawr) - local y = math.sin(pitchr) + local y = -math.sin(pitchr) playerLookVector = {x, y, z, x = x, y = y, z = z} return playerLookVector end