Merge pull request #661 from daemitus/corehookCatch

This commit is contained in:
goaaats 2021-10-26 17:49:29 +02:00 committed by GitHub
commit 7a54c0006a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,6 +5,7 @@ using Dalamud.Configuration.Internal;
using Dalamud.Hooking.Internal;
using Dalamud.Memory;
using Reloaded.Hooks;
using Serilog;
namespace Dalamud.Hooking
{
@ -54,7 +55,16 @@ namespace Dalamud.Hooking
this.address = address;
if (this.isCoreHook)
{
this.coreHookImpl = CoreHook.HookFactory.CreateHook<T>(address, detour);
try
{
this.coreHookImpl = CoreHook.HookFactory.CreateHook<T>(address, detour);
}
catch (Exception ex)
{
this.isCoreHook = false;
Log.Error(ex, "CoreHook is having a bad day, defaulting to Reloaded");
this.hookImpl = ReloadedHooks.Instance.CreateHook<T>(detour, address.ToInt64());
}
}
else
{