Compare commits

..

3 Commits

Author SHA1 Message Date
metalgearsloth
b6cadfedd5 Update arch (#4605) 2023-11-25 14:56:56 +11:00
metalgearsloth
9f57b705d7 Version: 182.0.0 2023-11-24 00:21:00 +11:00
metalgearsloth
68be9712ad Add entity gen to hashcode (#4601) 2023-11-24 00:19:58 +11:00
6 changed files with 20 additions and 14 deletions

View File

@@ -1,4 +1,4 @@
<Project>
<!-- This file automatically reset by Tools/version.py -->
<!-- This file automatically reset by Tools/version.py -->

View File

@@ -54,6 +54,13 @@ END TEMPLATE-->
*None yet*
## 182.0.0
### Breaking changes
* Add EntityUid's generation / version to the hashcode.
## 181.0.2
### Bugfixes

View File

@@ -5,30 +5,26 @@ namespace Robust.Shared.GameObjects;
internal struct ArchetypeIterator
{
private readonly Query _query;
private readonly PooledList<Archetype> _archetypes;
internal ArchetypeIterator(in Query query, PooledList<Archetype> archetypes)
internal ArchetypeIterator(PooledList<Archetype> archetypes)
{
_query = query;
_archetypes = archetypes;
}
public ArchetypeEnumerator GetEnumerator()
{
return new ArchetypeEnumerator(_query, _archetypes);
return new ArchetypeEnumerator(_archetypes);
}
}
internal struct ArchetypeEnumerator
{
private readonly Query _query;
private readonly PooledList<Archetype> _archetypes;
private int _index;
public ArchetypeEnumerator(in Query query, PooledList<Archetype> archetypes)
public ArchetypeEnumerator(PooledList<Archetype> archetypes)
{
_query = query;
_archetypes = archetypes;
_index = _archetypes.Count;
}
@@ -38,7 +34,7 @@ internal struct ArchetypeEnumerator
while (--_index >= 0)
{
var archetype = Current;
if (archetype.Entities > 0)
if (archetype.EntityCount > 0)
{
return true;
}

View File

@@ -29,7 +29,7 @@ internal struct ArchChunkEnumerator
if (_archetypes.MoveNext())
{
_chunkIndex = _archetypes.Current.Size;
_chunkIndex = _archetypes.Current.ChunkCount;
}
}
@@ -45,7 +45,7 @@ internal struct ArchChunkEnumerator
return false;
}
_chunkIndex = _archetypes.Current.Size - 1;
_chunkIndex = _archetypes.Current.ChunkCount - 1;
return true;
}
}
@@ -54,7 +54,7 @@ internal static partial class QueryExtensions
{
internal static ArchChunkIterator ChunkIterator(this in Query query, World world)
{
var archetypeEnumerator = new ArchetypeEnumerator(in query, query.Matches);
var archetypeEnumerator = new ArchetypeEnumerator(query.Matches);
return new ArchChunkIterator(in archetypeEnumerator);
}
}

View File

@@ -115,7 +115,10 @@ namespace Robust.Shared.GameObjects
/// <inheritdoc />
public override int GetHashCode()
{
return Id;
unchecked
{
return Id.GetHashCode() * 397 ^ Version.GetHashCode();
}
}
/// <summary>