fix: vfunc change
This commit is contained in:
parent
abd87b60f1
commit
fb6d998725
|
@ -26,6 +26,16 @@ internal sealed unsafe class Context {
|
||||||
[Signature("E8 ?? ?? ?? ?? EB 45 45 33 C9", Fallibility = Fallibility.Fallible)]
|
[Signature("E8 ?? ?? ?? ?? EB 45 45 33 C9", Fallibility = Fallibility.Fallible)]
|
||||||
private readonly delegate* unmanaged<void*, uint, byte, void> _searchForItem = null!;
|
private readonly delegate* unmanaged<void*, uint, byte, void> _searchForItem = null!;
|
||||||
|
|
||||||
|
#region Offsets
|
||||||
|
|
||||||
|
[Signature(
|
||||||
|
"FF 90 ?? ?? ?? ?? 8B 93 ?? ?? ?? ?? 48 8B C8 E8 ?? ?? ?? ?? E9 ?? ?? ?? ?? 41 B4 01",
|
||||||
|
Offset = 2
|
||||||
|
)]
|
||||||
|
private readonly int? _searchForRecipesUsingItemVfunc;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
private Plugin Plugin { get; }
|
private Plugin Plugin { get; }
|
||||||
|
|
||||||
internal Context(Plugin plugin) {
|
internal Context(Plugin plugin) {
|
||||||
|
@ -82,13 +92,13 @@ internal sealed unsafe class Context {
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void SearchForRecipesUsingItem(uint itemId) {
|
internal void SearchForRecipesUsingItem(uint itemId) {
|
||||||
if (this._searchForRecipesUsingItem == null) {
|
if (this._searchForRecipesUsingItem == null || this._searchForRecipesUsingItemVfunc is not { } offset) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var uiModule = Framework.Instance()->GetUiModule();
|
var uiModule = Framework.Instance()->GetUiModule();
|
||||||
var vf36 = (delegate* unmanaged<UIModule*, IntPtr>) uiModule->vfunc[36];
|
var vf = (delegate* unmanaged<UIModule*, IntPtr>) uiModule->vfunc[offset / 8];
|
||||||
var a1 = vf36(uiModule);
|
var a1 = vf(uiModule);
|
||||||
this._searchForRecipesUsingItem(a1, itemId);
|
this._searchForRecipesUsingItem(a1, itemId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -189,7 +189,7 @@ internal unsafe class GameFunctions : IDisposable {
|
||||||
// this just probably needs to be set
|
// this just probably needs to be set
|
||||||
agent->AddonId = addon->ID;
|
agent->AddonId = addon->ID;
|
||||||
|
|
||||||
// vcall from E8 ?? ?? ?? ?? 0F B7 C0 48 83 C4 60
|
// vcall from E8 ?? ?? ?? ?? 0F B7 C0 48 83 C4 60 (FF 50 28 48 8B D3 48 8B CF)
|
||||||
var vf5 = (delegate* unmanaged<AtkUnitBase*, byte, uint, void>*) ((IntPtr) addon->VTable + 40);
|
var vf5 = (delegate* unmanaged<AtkUnitBase*, byte, uint, void>*) ((IntPtr) addon->VTable + 40);
|
||||||
// EA8BED: lets vf5 actually run
|
// EA8BED: lets vf5 actually run
|
||||||
*(byte*) ((IntPtr) atkStage + 0x2B4) |= 2;
|
*(byte*) ((IntPtr) atkStage + 0x2B4) |= 2;
|
||||||
|
@ -210,7 +210,7 @@ internal unsafe class GameFunctions : IDisposable {
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void OpenPartyFinder() {
|
internal static void OpenPartyFinder() {
|
||||||
// this whole method: 6.05: 84433A
|
// this whole method: 6.05: 84433A (FF 97 ?? ?? ?? ?? 41 B4 01)
|
||||||
var lfg = Framework.Instance()->GetUiModule()->GetAgentModule()->GetAgentByInternalId(AgentId.LookingForGroup);
|
var lfg = Framework.Instance()->GetUiModule()->GetAgentModule()->GetAgentByInternalId(AgentId.LookingForGroup);
|
||||||
if (lfg->IsAgentActive()) {
|
if (lfg->IsAgentActive()) {
|
||||||
var addonId = lfg->GetAddonID();
|
var addonId = lfg->GetAddonID();
|
||||||
|
@ -273,7 +273,7 @@ internal unsafe class GameFunctions : IDisposable {
|
||||||
Type = ValueType.Int,
|
Type = ValueType.Int,
|
||||||
Int = 3,
|
Int = 3,
|
||||||
};
|
};
|
||||||
int result = 0;
|
var result = 0;
|
||||||
var vf0 = *(delegate* unmanaged<AgentInterface*, int*, AtkValue*, ulong, ulong, int*>*) agent->VTable;
|
var vf0 = *(delegate* unmanaged<AgentInterface*, int*, AtkValue*, ulong, ulong, int*>*) agent->VTable;
|
||||||
vf0(agent, &result, &value, 0, 0);
|
vf0(agent, &result, &value, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue