We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c69f1f commit 1a3b431Copy full SHA for 1a3b431
NetScape.Modules.World/PlayerEntityList.cs
@@ -12,7 +12,7 @@ public class PlayerEntityList : IEntityList<Player>
12
{
13
private readonly Player[] _entities = new Player[2048];
14
private int _entityCount = 0;
15
- private List<int> _freeIndexes = new();
+ private readonly List<int> _freeIndexes = new();
16
17
public void Add(Player entity)
18
@@ -32,14 +32,14 @@ public void Add(Player entity)
32
33
private void SetIndex(Player entity, int index)
34
35
+ _freeIndexes.Remove(index);
36
entity.Index = index;
37
_entities[index] = entity;
38
}
39
40
public void Remove(Player entity)
41
42
_entities[entity.Index] = null;
- _freeIndexes.Remove(entity.Index);
43
Interlocked.Decrement(ref _entityCount);
44
45
0 commit comments