mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
feat: Add helper to get the character's current mount
This commit is contained in:
parent
4ddd9c99fb
commit
56f7da5e0c
1 changed files with 17 additions and 0 deletions
|
|
@ -93,6 +93,11 @@ public interface ICharacter : IGameObject
|
||||||
/// Gets the status flags.
|
/// Gets the status flags.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public StatusFlags StatusFlags { get; }
|
public StatusFlags StatusFlags { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the current mount for this character. Will be <c>null</c> if the character doesn't have a mount.
|
||||||
|
/// </summary>
|
||||||
|
public ExcelResolver<Mount>? CurrentMount { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -173,6 +178,18 @@ internal unsafe class Character : GameObject, ICharacter
|
||||||
(this.Struct->IsFriend ? StatusFlags.Friend : StatusFlags.None) |
|
(this.Struct->IsFriend ? StatusFlags.Friend : StatusFlags.None) |
|
||||||
(this.Struct->IsCasting ? StatusFlags.IsCasting : StatusFlags.None);
|
(this.Struct->IsCasting ? StatusFlags.IsCasting : StatusFlags.None);
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public ExcelResolver<Mount>? CurrentMount
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (this.Struct->IsNotMounted()) return null; // safety i guess?
|
||||||
|
|
||||||
|
var mountId = this.Struct->Mount.MountId;
|
||||||
|
return mountId == 0 ? null : new ExcelResolver<Mount>(mountId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the underlying structure.
|
/// Gets the underlying structure.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue