Fix entity relation inconsistency on destroy

pull/4/head
cosmonaut 2023-02-09 15:15:55 -08:00
parent f534ff145e
commit cf75824d67
1 changed files with 1 additions and 0 deletions

View File

@ -97,6 +97,7 @@ namespace MoonTools.ECS
foreach (var relationTypeIndex in EntityStorage.RelationTypeIndices(entity.ID))
{
RelationDepot.UnrelateAll(entity.ID, relationTypeIndex);
EntityStorage.RemoveRelation(entity.ID, relationTypeIndex);
}
EntityStorage.Destroy(entity);