From 9ad54e7fe3646759cbac9e64dd546bcd65b45bc8 Mon Sep 17 00:00:00 2001 From: FlayaN Date: Thu, 4 Jul 2024 18:47:32 +0200 Subject: [PATCH] feat: fix VR offsets --- extern/CommonLibSSE-NG | 2 +- src/Features/Skylighting.h | 2 +- src/Hooks.cpp | 6 +++--- src/XSEPlugin.cpp | 4 ++++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/extern/CommonLibSSE-NG b/extern/CommonLibSSE-NG index e83b23bdd..735fa6dae 160000 --- a/extern/CommonLibSSE-NG +++ b/extern/CommonLibSSE-NG @@ -1 +1 @@ -Subproject commit e83b23bddb893d44b8f3cf3e6379b9087ad25cc9 +Subproject commit 735fa6dae8ec72966ee02673dd689c6516d49f71 diff --git a/src/Features/Skylighting.h b/src/Features/Skylighting.h index c89a03d8e..64340d601 100644 --- a/src/Features/Skylighting.h +++ b/src/Features/Skylighting.h @@ -452,7 +452,7 @@ struct Skylighting : Feature { logger::info("[SKYLIGHTING] Hooking BSLightingShaderProperty::GetPrecipitationOcclusionMapRenderPassesImp"); stl::write_vfunc<0x2D, BSLightingShaderProperty_GetPrecipitationOcclusionMapRenderPassesImpl>(RE::VTABLE_BSLightingShaderProperty[0]); - stl::write_thunk_call(REL::RelocationID(35560, 36559).address() + REL::Relocate(0x3A1, 0x3A1)); + stl::write_thunk_call(REL::RelocationID(35560, 36559).address() + REL::Relocate(0x3A1, 0x3A1, 0x2FA)); stl::write_vfunc<0x4, BSWaterShader_SetupMaterial>(RE::VTABLE_BSWaterShader[0]); } }; diff --git a/src/Hooks.cpp b/src/Hooks.cpp index e4a3bee5c..af7e88969 100644 --- a/src/Hooks.cpp +++ b/src/Hooks.cpp @@ -462,8 +462,8 @@ namespace Hooks logger::info("Hooking BSShader::BeginTechnique"); *(uintptr_t*)&ptr_BSShader_BeginTechnique = Detours::X64::DetourFunction(REL::RelocationID(101341, 108328).address(), (uintptr_t)&hk_BSShader_BeginTechnique); - stl::write_thunk_call(REL::RelocationID(101341, 101341).address() + REL::Relocate(0xC3, 0x3F3, 0x548)); - stl::write_thunk_call(REL::RelocationID(101341, 101341).address() + REL::Relocate(0xD7, 0x3F3, 0x548)); + stl::write_thunk_call(REL::RelocationID(101341, 101341).address() + REL::Relocate(0xC3, 0x3F3)); + stl::write_thunk_call(REL::RelocationID(101341, 101341).address() + REL::Relocate(0xD7, 0x3F3)); logger::info("Hooking BSGraphics::SetDirtyStates"); *(uintptr_t*)&ptr_BSGraphics_SetDirtyStates = Detours::X64::DetourFunction(REL::RelocationID(75580, 77386).address(), (uintptr_t)&hk_BSGraphics_SetDirtyStates); @@ -489,6 +489,6 @@ namespace Hooks stl::write_thunk_call(REL::RelocationID(100458, 107175).address() + REL::Relocate(0x406, 0x409)); stl::write_thunk_call(REL::RelocationID(100458, 107175).address() + REL::Relocate(0x555, 0x554, 0x6b9)); - stl::write_thunk_call(REL::RelocationID(100458, 107175).address() + REL::Relocate(0x1245, 0x554, 0x6b9)); + stl::write_thunk_call(REL::RelocationID(100458, 107175).address() + REL::Relocate(0x1245, 0x554, 0x1917)); } } \ No newline at end of file diff --git a/src/XSEPlugin.cpp b/src/XSEPlugin.cpp index bc09fc393..35d890bc4 100644 --- a/src/XSEPlugin.cpp +++ b/src/XSEPlugin.cpp @@ -148,6 +148,10 @@ bool Load() return true; } + if (REL::Module::IsVR()) { + REL::IDDatabase::get().IsVRAddressLibraryAtLeastVersion("0.138.0", true); + } + auto messaging = SKSE::GetMessagingInterface(); messaging->RegisterListener("SKSE", MessageHandler);