use Hook<T>.FromAddress() instead of new Hook<T>()

This commit is contained in:
2022-07-13 20:20:57 +02:00
parent 5085502b94
commit a3b482de35

View File

@@ -67,7 +67,7 @@ namespace PlayerTags.GameInterface.Nameplates
if (m_PluginAddressResolver.SetPlayerNameplatePtr.HasValue)
{
m_SetPlayerNameplateHook = new Hook<SetPlayerNameplateDelegate_Unmanaged>(m_PluginAddressResolver.SetPlayerNameplatePtr.Value, new SetPlayerNameplateDelegate_Unmanaged(SetPlayerNameplateDetour));
m_SetPlayerNameplateHook = Hook<SetPlayerNameplateDelegate_Unmanaged>.FromAddress(m_PluginAddressResolver.SetPlayerNameplatePtr.Value, new SetPlayerNameplateDelegate_Unmanaged(SetPlayerNameplateDetour));
m_SetPlayerNameplateHook?.Enable();
}
}