mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +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.
|
||||
/// </summary>
|
||||
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>
|
||||
|
|
@ -172,6 +177,18 @@ internal unsafe class Character : GameObject, ICharacter
|
|||
(this.Struct->IsAllianceMember ? StatusFlags.AllianceMember : StatusFlags.None) |
|
||||
(this.Struct->IsFriend ? StatusFlags.Friend : 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>
|
||||
/// Gets the underlying structure.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue