aers / FFXIVClientStructs

Resources for reverse-engineering the FFXIV client's native classes.
MIT License
218 stars 152 forks source link

[Not Dawntrain] Fix incorrect return type #926

Closed MidoriKami closed 2 months ago

MidoriKami commented 2 months ago

Addon Lifecycle originally tried to use OnRefresh as a void return, but that caused a bunch of corruption errors, we discovered this issue and fixed it using our own delegate. Since then ClientStructs has added these functions, but they were added with the wrong return type.

char Component::GUI::AtkUnitBase_OnRefresh()
{
  return 1;
}
char __fastcall Component::GUI::AtkUnitManager_RefreshAddon(
        __int64 a1,
        Component::GUI::AtkUnitBase *a2,
        unsigned int a3,
        Component::GUI::AtkValue *a4)
{
  if ( !a2 )
    return 0;
  Component::GUI::AtkUnitBase_SetAtkValues(a2, a3, a4);
  return (a2->union.vtable->OnRefresh)(a2, a3, a2->AtkValues);
}

rider64_KL51OblxdS