From a3b482de351e8b3eaca0f5e88bb076cab41adfcf Mon Sep 17 00:00:00 2001 From: Pilzinsel64 Date: Wed, 13 Jul 2022 20:20:57 +0200 Subject: [PATCH] use Hook.FromAddress() instead of new Hook() --- PlayerTags/GameInterface/Nameplates/Nameplate.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PlayerTags/GameInterface/Nameplates/Nameplate.cs b/PlayerTags/GameInterface/Nameplates/Nameplate.cs index ecd3add..f1013c4 100644 --- a/PlayerTags/GameInterface/Nameplates/Nameplate.cs +++ b/PlayerTags/GameInterface/Nameplates/Nameplate.cs @@ -67,7 +67,7 @@ namespace PlayerTags.GameInterface.Nameplates if (m_PluginAddressResolver.SetPlayerNameplatePtr.HasValue) { - m_SetPlayerNameplateHook = new Hook(m_PluginAddressResolver.SetPlayerNameplatePtr.Value, new SetPlayerNameplateDelegate_Unmanaged(SetPlayerNameplateDetour)); + m_SetPlayerNameplateHook = Hook.FromAddress(m_PluginAddressResolver.SetPlayerNameplatePtr.Value, new SetPlayerNameplateDelegate_Unmanaged(SetPlayerNameplateDetour)); m_SetPlayerNameplateHook?.Enable(); } }