From 957622a17016ca61a7c6df1987bd4eb6f705887f Mon Sep 17 00:00:00 2001 From: Edmand46 Date: Sun, 28 Aug 2022 00:18:26 +0400 Subject: [PATCH] fix: on player leave logic --- Ragon/Sources/Game/GameRoom.cs | 4 ++-- Ragon/Sources/Player/Player.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Ragon/Sources/Game/GameRoom.cs b/Ragon/Sources/Game/GameRoom.cs index da487db..c6e06b4 100755 --- a/Ragon/Sources/Game/GameRoom.cs +++ b/Ragon/Sources/Game/GameRoom.cs @@ -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(); diff --git a/Ragon/Sources/Player/Player.cs b/Ragon/Sources/Player/Player.cs index 6274afd..89c0f56 100755 --- a/Ragon/Sources/Player/Player.cs +++ b/Ragon/Sources/Player/Player.cs @@ -11,6 +11,6 @@ namespace Ragon.Core public bool IsLoaded { get; set; } public List Entities; - public List EntitiesIds; + public List EntitiesIds; } } \ No newline at end of file