From c294aba7ae59ebc70e237d3a1cefe289f5c83434 Mon Sep 17 00:00:00 2001 From: fed <58637860+fedddddd@users.noreply.github.com> Date: Sun, 29 Jan 2023 21:49:18 +0100 Subject: [PATCH] Fix safe_func --- src/client/component/gsc/script_error.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/client/component/gsc/script_error.cpp b/src/client/component/gsc/script_error.cpp index 0d6ae30e..15b71d72 100644 --- a/src/client/component/gsc/script_error.cpp +++ b/src/client/component/gsc/script_error.cpp @@ -87,8 +87,7 @@ namespace gsc void safe_func() { static utils::hook::detour hook; - - const auto stub = []() + static const auto stub = []() { __try { @@ -101,7 +100,7 @@ namespace gsc }; const auto ptr = rva + 0_b; - hook.create(ptr, stub); + hook.create(reinterpret_cast(ptr), stub); } }