From 3de56c992fb33841a91fad6008aabb127964f281 Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Sun, 17 Jul 2022 23:11:46 +0200 Subject: [PATCH] fix: activate reloaded hook immediately after instantiation --- Dalamud/Hooking/Internal/ReloadedHook.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Dalamud/Hooking/Internal/ReloadedHook.cs b/Dalamud/Hooking/Internal/ReloadedHook.cs index d82b452a3..ae4425785 100644 --- a/Dalamud/Hooking/Internal/ReloadedHook.cs +++ b/Dalamud/Hooking/Internal/ReloadedHook.cs @@ -29,6 +29,7 @@ namespace Dalamud.Hooking.Internal } this.hookImpl = ReloadedHooks.Instance.CreateHook(detour, address.ToInt64()); + this.hookImpl.Activate(); HookManager.TrackedHooks.TryAdd(Guid.NewGuid(), new HookInfo(this, detour, callingAssembly)); } @@ -75,9 +76,6 @@ namespace Dalamud.Hooking.Internal lock (HookManager.HookEnableSyncRoot) { - if (!this.hookImpl.IsHookActivated) - this.hookImpl.Activate(); - if (!this.hookImpl.IsHookEnabled) this.hookImpl.Enable(); }