fix snapshot edge cases + fix debug component list

pull/7/head
cosmonaut 2023-12-20 14:51:19 -08:00
parent 2adecf771a
commit d2b8e68b08
2 changed files with 4 additions and 4 deletions

View File

@ -60,7 +60,7 @@ public class Snapshot : IDisposable
relationStorage.Clear();
}
for (var i = 0; i < world.ComponentIndex.Count; i += 1)
for (var i = 0; i < ComponentSnapshots.Count; i += 1)
{
var componentStorage = world.ComponentIndex[i];
ComponentSnapshots[i].Restore(componentStorage);
@ -106,10 +106,9 @@ public class Snapshot : IDisposable
}
// restore entity tags
world.EntityTags.Clear();
foreach (var s in EntityTags)
for (var i = 0; i < EntityTags.Count; i += 1)
{
world.EntityTags.Add(s);
world.EntityTags[i] = EntityTags[i];
}
}

View File

@ -36,6 +36,7 @@ public class ComponentTypeIdAssigner<T> : ComponentTypeIdAssigner
#if DEBUG
World.ComponentTypeToId[typeof(T)] = new TypeId(Id);
World.ComponentTypeIdToType.Add(typeof(T));
#endif
}
}