From 7830e72c29cd63f2c4f2f0154eb4c0bf823025de Mon Sep 17 00:00:00 2001 From: copygirl Date: Sat, 6 May 2023 21:22:19 +0200 Subject: [PATCH] Fix IsAlive throwing if entity is None --- src/gaemstone.ECS/Entity.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gaemstone.ECS/Entity.cs b/src/gaemstone.ECS/Entity.cs index 2d96b3e..11a008f 100644 --- a/src/gaemstone.ECS/Entity.cs +++ b/src/gaemstone.ECS/Entity.cs @@ -19,7 +19,7 @@ public unsafe readonly partial struct Entity public bool IsSome => Value.IsSome; public bool IsValid => EntityAccess.IsValid(World, this); - public bool IsAlive => EntityAccess.IsAlive(World, this); + public bool IsAlive => IsSome && EntityAccess.IsAlive(World, this); public string? Name { get => EntityAccess.GetName(World, this); set => EntityAccess.SetName(World, this, value); } public string? Symbol { get => EntityAccess.GetSymbol(World, this); set => EntityAccess.SetSymbol(World, this, value); }