Fix FavoriteAetherytes

This commit is contained in:
Haselnussbomber 2025-10-06 01:38:35 +02:00
parent a55c8ca773
commit bcf651b5c1
No known key found for this signature in database
GPG key ID: BB905BB49E7295D1
2 changed files with 7 additions and 4 deletions

View file

@ -118,15 +118,18 @@ internal unsafe class PlayerState : IServiceType, IPlayerState
public RowRef<Aetheryte> HomeAetheryte => this.IsLoaded ? LuminaUtils.CreateRef<Aetheryte>(CSPlayerState.Instance()->HomeAetheryteId) : default;
/// <inheritdoc/>
public ReadOnlySpan<RowRef<Aetheryte>> FavouriteAetherytes
public ReadOnlySpan<RowRef<Aetheryte>> FavoriteAetherytes
{
get
{
var playerState = CSPlayerState.Instance();
if (playerState->IsLoaded || playerState->FavouriteAetheryteCount == 0)
return [];
if (!playerState->IsLoaded)
return default;
var count = playerState->FavouriteAetheryteCount;
if (count == 0)
return default;
var array = new RowRef<Aetheryte>[count];
for (var i = 0; i < count; i++)

View file

@ -149,7 +149,7 @@ public interface IPlayerState
/// <summary>
/// Gets a span of Aetheryte rows for the local player's favourite aetherytes.
/// </summary>
ReadOnlySpan<RowRef<Aetheryte>> FavouriteAetherytes { get; }
ReadOnlySpan<RowRef<Aetheryte>> FavoriteAetherytes { get; }
/// <summary>
/// Gets the Aetheryte row for the local player's free aetheryte.