From 0264b1b7d7e3c1afb082e73dffa6ea9afceae369 Mon Sep 17 00:00:00 2001 From: Dragon Date: Mon, 14 Nov 2022 12:02:58 +0200 Subject: [PATCH 1/2] Add IsDead boolean property to Dalamud.Game.ClientState.Objects.Types.Character --- Dalamud/Game/ClientState/Objects/Types/Character.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dalamud/Game/ClientState/Objects/Types/Character.cs b/Dalamud/Game/ClientState/Objects/Types/Character.cs index 093da7ebd..4186fd762 100644 --- a/Dalamud/Game/ClientState/Objects/Types/Character.cs +++ b/Dalamud/Game/ClientState/Objects/Types/Character.cs @@ -99,6 +99,11 @@ public unsafe class Character : GameObject /// public ExcelResolver OnlineStatus => new(this.Struct->OnlineStatus); + /// + /// Gets a value indicating whether the character is dead or alive. + /// + public bool IsDead => this.Struct->EventState == 2; + /// /// Gets the status flags. /// From de912150034d7fe218307e5803b44078b23e025d Mon Sep 17 00:00:00 2001 From: Dragon Date: Mon, 14 Nov 2022 12:52:52 +0200 Subject: [PATCH 2/2] Move property to GameObject and call the virtual function instead --- Dalamud/Game/ClientState/Objects/Types/Character.cs | 5 ----- Dalamud/Game/ClientState/Objects/Types/GameObject.cs | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dalamud/Game/ClientState/Objects/Types/Character.cs b/Dalamud/Game/ClientState/Objects/Types/Character.cs index 4186fd762..093da7ebd 100644 --- a/Dalamud/Game/ClientState/Objects/Types/Character.cs +++ b/Dalamud/Game/ClientState/Objects/Types/Character.cs @@ -99,11 +99,6 @@ public unsafe class Character : GameObject /// public ExcelResolver OnlineStatus => new(this.Struct->OnlineStatus); - /// - /// Gets a value indicating whether the character is dead or alive. - /// - public bool IsDead => this.Struct->EventState == 2; - /// /// Gets the status flags. /// diff --git a/Dalamud/Game/ClientState/Objects/Types/GameObject.cs b/Dalamud/Game/ClientState/Objects/Types/GameObject.cs index 9cd0cccdb..b33420498 100644 --- a/Dalamud/Game/ClientState/Objects/Types/GameObject.cs +++ b/Dalamud/Game/ClientState/Objects/Types/GameObject.cs @@ -134,6 +134,11 @@ public unsafe partial class GameObject /// public byte YalmDistanceZ => this.Struct->YalmDistanceFromPlayerZ; + /// + /// Gets a value indicating whether the object is dead or alive. + /// + public bool IsDead => this.Struct->IsDead(); + /// /// Gets the position of this . ///