mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
Fix FavoriteAetherytes
This commit is contained in:
parent
a55c8ca773
commit
bcf651b5c1
2 changed files with 7 additions and 4 deletions
|
|
@ -118,15 +118,18 @@ internal unsafe class PlayerState : IServiceType, IPlayerState
|
||||||
public RowRef<Aetheryte> HomeAetheryte => this.IsLoaded ? LuminaUtils.CreateRef<Aetheryte>(CSPlayerState.Instance()->HomeAetheryteId) : default;
|
public RowRef<Aetheryte> HomeAetheryte => this.IsLoaded ? LuminaUtils.CreateRef<Aetheryte>(CSPlayerState.Instance()->HomeAetheryteId) : default;
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public ReadOnlySpan<RowRef<Aetheryte>> FavouriteAetherytes
|
public ReadOnlySpan<RowRef<Aetheryte>> FavoriteAetherytes
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
var playerState = CSPlayerState.Instance();
|
var playerState = CSPlayerState.Instance();
|
||||||
if (playerState->IsLoaded || playerState->FavouriteAetheryteCount == 0)
|
if (!playerState->IsLoaded)
|
||||||
return [];
|
return default;
|
||||||
|
|
||||||
var count = playerState->FavouriteAetheryteCount;
|
var count = playerState->FavouriteAetheryteCount;
|
||||||
|
if (count == 0)
|
||||||
|
return default;
|
||||||
|
|
||||||
var array = new RowRef<Aetheryte>[count];
|
var array = new RowRef<Aetheryte>[count];
|
||||||
|
|
||||||
for (var i = 0; i < count; i++)
|
for (var i = 0; i < count; i++)
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@ public interface IPlayerState
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a span of Aetheryte rows for the local player's favourite aetherytes.
|
/// Gets a span of Aetheryte rows for the local player's favourite aetherytes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ReadOnlySpan<RowRef<Aetheryte>> FavouriteAetherytes { get; }
|
ReadOnlySpan<RowRef<Aetheryte>> FavoriteAetherytes { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the Aetheryte row for the local player's free aetheryte.
|
/// Gets the Aetheryte row for the local player's free aetheryte.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue