From 39cc19df4897e042af7f4ff2b8318371170374d4 Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Thu, 24 Feb 2022 13:46:40 +0100 Subject: [PATCH] Fixed possessionLocation == null serialization problem --- .../HumanoidFree/Scripts/Networking/HumanoidNetworking.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Runtime/HumanoidFree/Scripts/Networking/HumanoidNetworking.cs b/Runtime/HumanoidFree/Scripts/Networking/HumanoidNetworking.cs index 0ee52b8..823706e 100644 --- a/Runtime/HumanoidFree/Scripts/Networking/HumanoidNetworking.cs +++ b/Runtime/HumanoidFree/Scripts/Networking/HumanoidNetworking.cs @@ -191,6 +191,8 @@ namespace Passer.Humanoid { bw.Write(name); bw.Write(avatarPrefabName); bw.Write(physics); + if (possessionLocation == null) + possessionLocation = ""; bw.Write(possessionLocation); #if RemoteAvatarBundles bw.Write(remoteAvatarBundleSize); @@ -1470,7 +1472,7 @@ namespace Passer.Humanoid { public ulong nwId; public byte humanoidId; public string avatarPrefabName; - public string possessionLocation; + public string possessionLocation = ""; public ChangeAvatar() { } public ChangeAvatar(HumanoidControl humanoid, string avatarPrefabName, string possessionLocation) { @@ -1488,6 +1490,8 @@ namespace Passer.Humanoid { bw.Write(nwId); bw.Write(humanoidId); bw.Write(avatarPrefabName); + if (possessionLocation == null) + possessionLocation = ""; bw.Write(possessionLocation); byte[] data = ms.ToArray(); @@ -1502,6 +1506,8 @@ namespace Passer.Humanoid { humanoidId = br.ReadByte(); avatarPrefabName = br.ReadString(); possessionLocation = br.ReadString(); + if (possessionLocation == "") + possessionLocation = null; } // This is the same code as in the base class IMessage