From fa32df0f9a2c491a1926171e439f052430fad4d9 Mon Sep 17 00:00:00 2001 From: xoxor4d Date: Sat, 3 Feb 2024 23:19:25 +0100 Subject: [PATCH] use predicted player origin for attached lights (fix lag) --- src/components/modules/rtx/rtx_lights.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/modules/rtx/rtx_lights.cpp b/src/components/modules/rtx/rtx_lights.cpp index b8400bf..07a2506 100644 --- a/src/components/modules/rtx/rtx_lights.cpp +++ b/src/components/modules/rtx/rtx_lights.cpp @@ -72,9 +72,9 @@ namespace components game::vec3_t fwd, rt, up = {}; utils::vector::angle_vectors(game::cgs->predictedPlayerState.viewangles, fwd, rt, up); - setting->origin[0] = game::glob::lpmove_camera_origin.x + (utils::vector::dot3(fwd, setting->dir_offset)); - setting->origin[1] = game::glob::lpmove_camera_origin.y + (utils::vector::dot3(rt, setting->dir_offset)); - setting->origin[2] = game::glob::lpmove_camera_origin.z + (utils::vector::dot3(up, setting->dir_offset)); + setting->origin[0] = game::cgs->predictedPlayerState.origin[0] + (utils::vector::dot3(fwd, setting->dir_offset)); + setting->origin[1] = game::cgs->predictedPlayerState.origin[1] + (utils::vector::dot3(rt, setting->dir_offset)); + setting->origin[2] = game::cgs->predictedPlayerState.origin[2] + game::cgs->predictedPlayerState.viewHeightCurrent + (utils::vector::dot3(up, setting->dir_offset)); utils::vector::copy(setting->origin, &ff_light->Position.x, 3);