From fab97a7a5fe3b1d4c900414a1ea06a00eabf2c2c Mon Sep 17 00:00:00 2001 From: Anna Date: Fri, 28 Jan 2022 04:31:26 -0500 Subject: [PATCH] refactor: add unmanaged to function pointers --- ChatTwo/GameFunctions/Context.cs | 2 +- ChatTwo/GameFunctions/GameFunctions.cs | 2 +- ChatTwo/GameFunctions/Party.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ChatTwo/GameFunctions/Context.cs b/ChatTwo/GameFunctions/Context.cs index b0c166b..839e589 100755 --- a/ChatTwo/GameFunctions/Context.cs +++ b/ChatTwo/GameFunctions/Context.cs @@ -40,7 +40,7 @@ internal sealed unsafe class Context { var uiModule = Framework.Instance()->GetUiModule(); // 6.05: 20D722 - var func = (delegate*) uiModule->vfunc[33]; + var func = (delegate* unmanaged) uiModule->vfunc[33]; var toIndex = func(uiModule); // 6.05: 20E4CB var a1 = this.Plugin.Functions.Indexer(toIndex, 0x11); diff --git a/ChatTwo/GameFunctions/GameFunctions.cs b/ChatTwo/GameFunctions/GameFunctions.cs index c442271..208ef14 100755 --- a/ChatTwo/GameFunctions/GameFunctions.cs +++ b/ChatTwo/GameFunctions/GameFunctions.cs @@ -174,7 +174,7 @@ internal unsafe class GameFunctions : IDisposable { agent->AddonId = (uint) addon->ID; // vcall from E8 ?? ?? ?? ?? 0F B7 C0 48 83 C4 60 - var vf5 = (delegate**) ((IntPtr) addon->VTable + 40); + var vf5 = (delegate* unmanaged*) ((IntPtr) addon->VTable + 40); // E8872D: lets vf5 actually run *(byte*) ((IntPtr) atkStage + 0x2B4) |= 2; (*vf5)(addon, 0, 15); diff --git a/ChatTwo/GameFunctions/Party.cs b/ChatTwo/GameFunctions/Party.cs index 167402e..0437d3b 100755 --- a/ChatTwo/GameFunctions/Party.cs +++ b/ChatTwo/GameFunctions/Party.cs @@ -31,7 +31,7 @@ internal sealed unsafe class Party { var uiModule = Framework.Instance()->GetUiModule(); // 6.05: 20D722 - var func = (delegate*) uiModule->vfunc[33]; + var func = (delegate* unmanaged) uiModule->vfunc[33]; var toIndex = func(uiModule); var a1 = this.Plugin.Functions.Indexer(toIndex, 1);