Skip to content

Commit f93ec35

Browse files
[Entities] Fix dead entity indices;
1 parent 9a6967d commit f93ec35

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Engine/Staple.Core/World/World.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ public Entity ToEntity()
9292
}
9393
};
9494
}
95+
96+
public override string ToString()
97+
{
98+
return alive ? $"{name} ({ID}:{generation})" : "Invalid Entity (Dead)";
99+
}
95100
}
96101

97102
/// <summary>
@@ -176,7 +181,7 @@ public int EntityCount
176181

177182
private EntityInfo[] cachedEntityList = [];
178183
private bool needsEmitWorldChange = false;
179-
private readonly HashSet<int> deadEntities = [];
184+
private readonly SortedSet<int> deadEntities = [];
180185

181186
private static readonly WorldChangeBox worldChangeReceivers = new();
182187
private static readonly SceneQueryBox sceneQueries = new();

0 commit comments

Comments
 (0)