From 3999cbc7aa3ddbe2e0310b5facc38c8143b472f2 Mon Sep 17 00:00:00 2001 From: Lukas0610 Date: Mon, 25 Sep 2023 16:34:04 +0200 Subject: [PATCH] use updated CGameEngine-field for ClipToCenter() --- src/overlay/Overlay.cpp | 8 ++++---- src/overlay/Overlay.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/overlay/Overlay.cpp b/src/overlay/Overlay.cpp index 873fcf88..56a0c9fb 100644 --- a/src/overlay/Overlay.cpp +++ b/src/overlay/Overlay.cpp @@ -18,7 +18,7 @@ void Overlay::PostInitialize() auto& d3d12 = CET::Get().GetD3D12(); d3d12.DelayedSetTrapInputInImGui(true); - ClipToCenter(RED4ext::CGameEngine::Get()->unkC0); + ClipToCenter(RED4ext::CGameEngine::Get()->unkD0); } m_initialized = true; @@ -190,7 +190,7 @@ void Overlay::Update() auto& d3d12 = CET::Get().GetD3D12(); d3d12.DelayedSetTrapInputInImGui(m_enabled); auto* pEngine = RED4ext::CGameEngine::Get(); - ClipToCenter(pEngine->unkC0); + ClipToCenter(pEngine->unkD0); m_toggled = false; } } @@ -219,10 +219,10 @@ bool Overlay::IsInitialized() const noexcept return m_initialized; } -BOOL Overlay::ClipToCenter(RED4ext::CGameEngine::UnkC0* apThis) +BOOL Overlay::ClipToCenter(RED4ext::CGameEngine::UnkD0* apThis) { - const auto wnd = static_cast(apThis->hWnd); const HWND foreground = GetForegroundWindow(); + const auto wnd = static_cast(apThis->hWnd); if (wnd == foreground && apThis->unk164 && !apThis->unk154 && !CET::Get().GetOverlay().IsEnabled()) { diff --git a/src/overlay/Overlay.h b/src/overlay/Overlay.h index 30ae8455..2bc9e7fb 100644 --- a/src/overlay/Overlay.h +++ b/src/overlay/Overlay.h @@ -7,7 +7,7 @@ #include "widgets/GameLog.h" #include "widgets/ImGuiDebug.h" -using TClipToCenter = HWND(RED4ext::CGameEngine::UnkC0*); +using TClipToCenter = HWND(RED4ext::CGameEngine::UnkD0*); struct Overlay { @@ -30,7 +30,7 @@ struct Overlay protected: void Hook(); - static BOOL ClipToCenter(RED4ext::CGameEngine::UnkC0* apThis); + static BOOL ClipToCenter(RED4ext::CGameEngine::UnkD0* apThis); private: void DrawToolbar();