fix: activate reloaded hook immediately after instantiation

This commit is contained in:
goat 2022-07-17 23:11:46 +02:00
parent d21c0f1947
commit 3de56c992f
No known key found for this signature in database
GPG key ID: 7773BB5B43BA52E5

View file

@ -29,6 +29,7 @@ namespace Dalamud.Hooking.Internal
} }
this.hookImpl = ReloadedHooks.Instance.CreateHook<T>(detour, address.ToInt64()); this.hookImpl = ReloadedHooks.Instance.CreateHook<T>(detour, address.ToInt64());
this.hookImpl.Activate();
HookManager.TrackedHooks.TryAdd(Guid.NewGuid(), new HookInfo(this, detour, callingAssembly)); HookManager.TrackedHooks.TryAdd(Guid.NewGuid(), new HookInfo(this, detour, callingAssembly));
} }
@ -75,9 +76,6 @@ namespace Dalamud.Hooking.Internal
lock (HookManager.HookEnableSyncRoot) lock (HookManager.HookEnableSyncRoot)
{ {
if (!this.hookImpl.IsHookActivated)
this.hookImpl.Activate();
if (!this.hookImpl.IsHookEnabled) if (!this.hookImpl.IsHookEnabled)
this.hookImpl.Enable(); this.hookImpl.Enable();
} }