From 71085cd6eec7f02865a0009f05771bd5504ead02 Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Tue, 22 Feb 2022 17:59:12 +0100 Subject: [PATCH] Fix unregistered double remote avatars when using local remotes --- .../Scripts/Networking/HumanoidNetworking.cs | 12 ++++++------ .../Scripts/Networking/HumanoidPlayer.cs | 2 +- Runtime/Visitors/Scripts/VisitorPossessions.cs | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Runtime/HumanoidFree/Scripts/Networking/HumanoidNetworking.cs b/Runtime/HumanoidFree/Scripts/Networking/HumanoidNetworking.cs index 6d72eb2..0ee52b8 100644 --- a/Runtime/HumanoidFree/Scripts/Networking/HumanoidNetworking.cs +++ b/Runtime/HumanoidFree/Scripts/Networking/HumanoidNetworking.cs @@ -316,14 +316,14 @@ namespace Passer.Humanoid { if (retrievedAvatar == null) { if (networking.debug <= DebugLevel.Error) Debug.LogError("Could not retrieve avatar."); - return; + //return; } + else { + if (networking.debug <= DebugLevel.Info) + networking.DebugLog("Receive Change Possessesable Avatar " + retrievedAvatar); - if (networking.debug <= DebugLevel.Info) - networking.DebugLog("Receive Change Possessesable Avatar " + retrievedAvatar); - - remoteHumanoid.LocalChangeAvatar(retrievedAvatar); - + remoteHumanoid.LocalChangeAvatar(retrievedAvatar); + } networking.humanoids.Add(remoteHumanoid); if (OnNewRemoteHumanoid != null) OnNewRemoteHumanoid(remoteHumanoid); diff --git a/Runtime/HumanoidFree/Scripts/Networking/HumanoidPlayer.cs b/Runtime/HumanoidFree/Scripts/Networking/HumanoidPlayer.cs index c96673d..53d14df 100644 --- a/Runtime/HumanoidFree/Scripts/Networking/HumanoidPlayer.cs +++ b/Runtime/HumanoidFree/Scripts/Networking/HumanoidPlayer.cs @@ -138,7 +138,7 @@ namespace Passer.Humanoid { humanoid.humanoidNetworking = this; - ((IHumanoidNetworking)this).InstantiateHumanoid(humanoid); + //((IHumanoidNetworking)this).InstantiateHumanoid(humanoid); } } diff --git a/Runtime/Visitors/Scripts/VisitorPossessions.cs b/Runtime/Visitors/Scripts/VisitorPossessions.cs index 0c1eb4e..81cdcf5 100644 --- a/Runtime/Visitors/Scripts/VisitorPossessions.cs +++ b/Runtime/Visitors/Scripts/VisitorPossessions.cs @@ -287,7 +287,8 @@ namespace Passer { if (possessableLocation == "") { Debug.Log("Cannot retrieve Possessable: location is not set"); - yield return null; + //yield return null; + callback(null); } else { Debug.Log("Cache size: " + cache.Count);