mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
fix: filter InvalidGameObjectId when getting ToT
This commit is contained in:
parent
1ae42607d3
commit
ed1a6c7810
1 changed files with 7 additions and 1 deletions
|
|
@ -12,6 +12,11 @@ namespace Dalamud.Game.ClientState.Objects.Types
|
|||
/// </summary>
|
||||
public unsafe partial class GameObject : IEquatable<GameObject>
|
||||
{
|
||||
/// <summary>
|
||||
/// IDs of non-networked GameObjects.
|
||||
/// </summary>
|
||||
public const uint InvalidGameObjectId = 0xE0000000;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GameObject"/> class.
|
||||
/// </summary>
|
||||
|
|
@ -156,7 +161,8 @@ namespace Dalamud.Game.ClientState.Objects.Types
|
|||
/// <remarks>
|
||||
/// This iterates the actor table, it should be used with care.
|
||||
/// </remarks>
|
||||
public virtual GameObject? TargetObject => Service<ObjectTable>.Get().SearchById(this.TargetObjectId);
|
||||
// TODO: Fix for non-networked GameObjects
|
||||
public virtual GameObject? TargetObject => this.TargetObjectId != InvalidGameObjectId ? Service<ObjectTable>.Get().SearchById(this.TargetObjectId) : null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the underlying structure.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue