Skip to content

Commit

Permalink
Fixed build
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanrw committed Oct 16, 2024
1 parent d638da8 commit 8f0f2bf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/Arch/Core/Archetype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ public sealed partial class Archetype
internal Archetype(Signature signature)
{
Signature = signature;
Types = signature;

// Calculations
ChunkSizeInBytes = MinimumRequiredChunkSize(signature);
Expand Down
4 changes: 2 additions & 2 deletions src/Arch/Core/Extensions/EntityExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public static Entity Duplicate(this in Entity entity)
public static void DuplicateN(this in Entity entity, Span<Entity> output)
{
var world = World.Worlds[entity.WorldId];
return world.DuplicateN(entity, output);
world.DuplicateN(entity, output);
}

/// <summary>
Expand All @@ -241,7 +241,7 @@ public static void DuplicateN(this in Entity entity, Span<Entity> output)
public static void DuplicateN(this in Entity entity, int n, Span<Entity> output)
{
var world = World.Worlds[entity.WorldId];
return world.DuplicateN(entity, n, output);
world.DuplicateN(entity, n, output);
}
#endif
}
Expand Down
6 changes: 3 additions & 3 deletions src/Arch/Core/World.cs
Original file line number Diff line number Diff line change
Expand Up @@ -597,16 +597,16 @@ public Entity Duplicate(Entity sourceEntity)
Entity destinationEntity = CreateNoEvent(archetype.Signature);
EntitySlot fromIndex = EntityInfo.GetEntitySlot(sourceEntity.Id);
EntitySlot destinationIndex = EntityInfo.GetEntitySlot(destinationEntity.Id);
ref Chunk fromChunk = archetype.GetChunk(fromIndex);
ref Chunk toChunk = archetype.GetChunk(destinationIndex);
ref Chunk fromChunk = ref archetype.GetChunk(fromIndex.Slot.ChunkIndex);
ref Chunk toChunk = ref archetype.GetChunk(destinationIndex.Slot.ChunkIndex);
for (int i = 0; i < fromChunk.Components.Length; ++i)
{
Array fromArray = fromChunk.Components[i];
Array toArray = toChunk.Components[i];
Array.Copy(fromArray, fromIndex.Slot.Index, toArray, destinationIndex.Slot.Index, 1);
}

OnEntityCreated(entity);
OnEntityCreated(sourceEntity);
#if EVENTS
foreach (ref var type in archetype.Types)
{
Expand Down

0 comments on commit 8f0f2bf

Please sign in to comment.