From ed1a6c78100c04f5dd1c25e3de1437628c8dc8b8 Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Fri, 27 Aug 2021 01:42:38 +0200 Subject: [PATCH] fix: filter InvalidGameObjectId when getting ToT --- Dalamud/Game/ClientState/Objects/Types/GameObject.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Dalamud/Game/ClientState/Objects/Types/GameObject.cs b/Dalamud/Game/ClientState/Objects/Types/GameObject.cs index 4f371bd28..b0504fbcc 100644 --- a/Dalamud/Game/ClientState/Objects/Types/GameObject.cs +++ b/Dalamud/Game/ClientState/Objects/Types/GameObject.cs @@ -12,6 +12,11 @@ namespace Dalamud.Game.ClientState.Objects.Types /// public unsafe partial class GameObject : IEquatable { + /// + /// IDs of non-networked GameObjects. + /// + public const uint InvalidGameObjectId = 0xE0000000; + /// /// Initializes a new instance of the class. /// @@ -156,7 +161,8 @@ namespace Dalamud.Game.ClientState.Objects.Types /// /// This iterates the actor table, it should be used with care. /// - public virtual GameObject? TargetObject => Service.Get().SearchById(this.TargetObjectId); + // TODO: Fix for non-networked GameObjects + public virtual GameObject? TargetObject => this.TargetObjectId != InvalidGameObjectId ? Service.Get().SearchById(this.TargetObjectId) : null; /// /// Gets the underlying structure.