Reorder, bail out early in Recipe and McGuffin

This commit is contained in:
Haselnussbomber 2026-01-11 01:38:32 +01:00
parent 4c5b5a604a
commit 98ef505b38
No known key found for this signature in database
GPG key ID: BB905BB49E7295D1

View file

@ -310,12 +310,6 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
return nativeRow != null && UIState.Instance()->IsItemActionUnlocked(nativeRow) == 1; return nativeRow != null && UIState.Instance()->IsItemActionUnlocked(nativeRow) == 1;
} }
/// <inheritdoc/>
public bool IsMcGuffinUnlocked(McGuffin row)
{
return PlayerState.Instance()->IsMcGuffinUnlocked(row.RowId);
}
/// <inheritdoc/> /// <inheritdoc/>
public bool IsMJILandmarkUnlocked(MJILandmark row) public bool IsMJILandmarkUnlocked(MJILandmark row)
{ {
@ -328,6 +322,15 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
return this.IsUnlockLinkUnlocked(row.UnlockLink); return this.IsUnlockLinkUnlocked(row.UnlockLink);
} }
/// <inheritdoc/>
public bool IsMcGuffinUnlocked(McGuffin row)
{
if (!this.IsLoaded)
return false;
return PlayerState.Instance()->IsMcGuffinUnlocked(row.RowId);
}
/// <inheritdoc/> /// <inheritdoc/>
public bool IsMountUnlocked(Mount row) public bool IsMountUnlocked(Mount row)
{ {
@ -388,6 +391,9 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
/// <inheritdoc/> /// <inheritdoc/>
public bool IsRecipeUnlocked(Recipe row) public bool IsRecipeUnlocked(Recipe row)
{ {
if (!this.IsLoaded)
return false;
return this.recipeData.IsRecipeUnlocked(row); return this.recipeData.IsRecipeUnlocked(row);
} }
@ -808,15 +814,15 @@ internal class UnlockStatePluginScoped : IInternalDisposableService, IUnlockStat
/// <inheritdoc/> /// <inheritdoc/>
public bool IsItemUnlocked(Item row) => this.unlockStateService.IsItemUnlocked(row); public bool IsItemUnlocked(Item row) => this.unlockStateService.IsItemUnlocked(row);
/// <inheritdoc/>
public bool IsMcGuffinUnlocked(McGuffin row) => this.unlockStateService.IsMcGuffinUnlocked(row);
/// <inheritdoc/> /// <inheritdoc/>
public bool IsMJILandmarkUnlocked(MJILandmark row) => this.unlockStateService.IsMJILandmarkUnlocked(row); public bool IsMJILandmarkUnlocked(MJILandmark row) => this.unlockStateService.IsMJILandmarkUnlocked(row);
/// <inheritdoc/> /// <inheritdoc/>
public bool IsMKDLoreUnlocked(MKDLore row) => this.unlockStateService.IsMKDLoreUnlocked(row); public bool IsMKDLoreUnlocked(MKDLore row) => this.unlockStateService.IsMKDLoreUnlocked(row);
/// <inheritdoc/>
public bool IsMcGuffinUnlocked(McGuffin row) => this.unlockStateService.IsMcGuffinUnlocked(row);
/// <inheritdoc/> /// <inheritdoc/>
public bool IsMountUnlocked(Mount row) => this.unlockStateService.IsMountUnlocked(row); public bool IsMountUnlocked(Mount row) => this.unlockStateService.IsMountUnlocked(row);