Skip to content

Commit

Permalink
[AddonLifecycle] Fix incorrect delegate signature (#1401)
Browse files Browse the repository at this point in the history
  • Loading branch information
MidoriKami authored Sep 18, 2023
1 parent 40a8e60 commit 5a3196e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Dalamud/Game/AddonLifecycle/AddonLifecycle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private AddonLifecycle(SigScanner sigScanner)

private delegate void AddonOnRequestedUpdateDelegate(AtkUnitBase* addon, NumberArrayData** numberArrayData, StringArrayData** stringArrayData);

private delegate void AddonOnRefreshDelegate(AtkUnitManager* unitManager, AtkUnitBase* addon, uint valueCount, AtkValue* values);
private delegate byte AddonOnRefreshDelegate(AtkUnitManager* unitManager, AtkUnitBase* addon, uint valueCount, AtkValue* values);

/// <inheritdoc/>
public void Dispose()
Expand Down Expand Up @@ -221,7 +221,7 @@ private void OnAddonUpdate(AtkUnitBase* addon, float delta)
}
}

private void OnAddonRefresh(AtkUnitManager* atkUnitManager, AtkUnitBase* addon, uint valueCount, AtkValue* values)
private byte OnAddonRefresh(AtkUnitManager* atkUnitManager, AtkUnitBase* addon, uint valueCount, AtkValue* values)
{
try
{
Expand All @@ -232,7 +232,7 @@ private void OnAddonRefresh(AtkUnitManager* atkUnitManager, AtkUnitBase* addon,
Log.Error(e, "Exception in OnAddonRefresh pre-refresh invoke.");
}

this.onAddonRefreshHook.Original(atkUnitManager, addon, valueCount, values);
var result = this.onAddonRefreshHook.Original(atkUnitManager, addon, valueCount, values);

try
{
Expand All @@ -242,6 +242,8 @@ private void OnAddonRefresh(AtkUnitManager* atkUnitManager, AtkUnitBase* addon,
{
Log.Error(e, "Exception in OnAddonRefresh post-refresh invoke.");
}

return result;
}

private void OnRequestedUpdate(AtkUnitBase* addon, NumberArrayData** numberArrayData, StringArrayData** stringArrayData)
Expand Down

0 comments on commit 5a3196e

Please sign in to comment.