fix: on player leave logic

This commit is contained in:
2022-08-28 00:18:26 +04:00
parent 4a07424293
commit 957622a170
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -108,7 +108,7 @@ namespace Ragon.Core
_serializer.WriteUShort((ushort) player.EntitiesIds.Count);
foreach (var entityId in player.EntitiesIds)
{
_serializer.WriteInt(entityId);
_serializer.WriteUShort(entityId);
_entities.Remove(entityId);
}
@@ -376,7 +376,7 @@ namespace Ragon.Core
player.Entities.Add(entity);
player.EntitiesIds.Add(entity.EntityId);
var ownerId = (ushort) peerId;
var ownerId = peerId;
_entities.Add(entity.EntityId, entity);
_entitiesAll = _entities.Values.ToArray();
+1 -1
View File
@@ -11,6 +11,6 @@ namespace Ragon.Core
public bool IsLoaded { get; set; }
public List<Entity> Entities;
public List<int> EntitiesIds;
public List<ushort> EntitiesIds;
}
}