diff --git a/src/Utils/DependencyGraph.cs b/src/Utils/DependencyGraph.cs index c499959..c1bddb2 100644 --- a/src/Utils/DependencyGraph.cs +++ b/src/Utils/DependencyGraph.cs @@ -158,12 +158,16 @@ namespace DCFApixels.DragonECS.Core private void AddVertexByID(VertexID id) { ref var info = ref GetVertexInfo(id); - if (info.isContained == false || info.isLocked == false) + + if (info.isContained == false && info.isLocked || info.isLocked == false) + { + info.insertionIndex = _increment++; + } + if (info.isContained == false) { _count++; info.isContained = true; } - info.insertionIndex = _increment++; } public bool RemoveVertex(T vertex) {