Cache completed Quests in RecipeData too

This commit is contained in:
Haselnussbomber 2025-10-02 03:23:54 +02:00
parent 62fdd2c60d
commit 5905afdf10
No known key found for this signature in database
GPG key ID: BB905BB49E7295D1

View file

@ -5,6 +5,7 @@ using CommunityToolkit.HighPerformance;
using Dalamud.Data;
using Dalamud.Game.Gui;
using FFXIVClientStructs.FFXIV.Client.Game;
using FFXIVClientStructs.FFXIV.Client.Game.UI;
using FFXIVClientStructs.Interop;
@ -33,6 +34,7 @@ internal unsafe class RecipeData : IInternalDisposableService
private readonly ushort[,] noteBookDivisionIds;
private byte[]? cachedUnlockedSecretRecipeBooks;
private byte[]? cachedUnlockLinks;
private byte[]? cachedCompletedQuests;
/// <summary>
/// Initializes a new instance of the <see cref="RecipeData"/> class.
@ -105,6 +107,7 @@ internal unsafe class RecipeData : IInternalDisposableService
{
this.cachedUnlockedSecretRecipeBooks = null;
this.cachedUnlockLinks = null;
this.cachedCompletedQuests = null;
}
private void Update()
@ -252,6 +255,12 @@ internal unsafe class RecipeData : IInternalDisposableService
changed |= true;
}
if (this.cachedCompletedQuests == null || !QuestManager.Instance()->CompletedQuestsBitmask.SequenceEqual(this.cachedCompletedQuests))
{
this.cachedCompletedQuests = QuestManager.Instance()->CompletedQuestsBitmask.ToArray();
changed |= true;
}
return changed;
}
}