From 861962feb5a816d2a4f51d9f30e5e4e75c84064e Mon Sep 17 00:00:00 2001 From: _nebula <41904486+misternebula@users.noreply.github.com> Date: Mon, 13 Nov 2023 21:59:46 +0000 Subject: [PATCH] fix some skins not syncing on join --- .../Messages/PlayerInformationMessage.cs | 6 +++-- QSB/Player/PlayerInfoParts/Body.cs | 23 +------------------ 2 files changed, 5 insertions(+), 24 deletions(-) diff --git a/QSB/Player/Messages/PlayerInformationMessage.cs b/QSB/Player/Messages/PlayerInformationMessage.cs index 10f9a078d..ff60426e2 100644 --- a/QSB/Player/Messages/PlayerInformationMessage.cs +++ b/QSB/Player/Messages/PlayerInformationMessage.cs @@ -106,11 +106,13 @@ public override void OnReceiveRemote() { player.UpdateObjectsFromStates(); player.HelmetAnimator.SetHelmetInstant(HelmetOn); + player.Camera.fieldOfView = FieldOfView; + }); + Delay.RunWhen(() => player.Body != null, () => + { var REMOTE_Traveller_HEA_Player_v2 = player.Body.transform.Find("REMOTE_Traveller_HEA_Player_v2"); BodyCustomization.BodyCustomizer.Instance.CustomizeRemoteBody(REMOTE_Traveller_HEA_Player_v2.gameObject, player.HelmetAnimator.FakeHead.gameObject, SkinType, JetpackType); - - player.Camera.fieldOfView = FieldOfView; }); player.State = ClientState; diff --git a/QSB/Player/PlayerInfoParts/Body.cs b/QSB/Player/PlayerInfoParts/Body.cs index f2f3702e9..4edc9a315 100644 --- a/QSB/Player/PlayerInfoParts/Body.cs +++ b/QSB/Player/PlayerInfoParts/Body.cs @@ -23,28 +23,7 @@ public OWCamera Camera public GameObject CameraBody { get; set; } - public GameObject Body - { - get - { - if (_body == null && IsReady) - { - DebugLog.ToConsole($"Warning - {PlayerId}.Body is null!", MessageType.Warning); - } - - return _body; - } - set - { - if (value == null) - { - DebugLog.ToConsole($"Warning - Setting {PlayerId}.Body to null.", MessageType.Warning); - } - - _body = value; - } - } - private GameObject _body; + public GameObject Body { get; set; } /// /// remote light sensor is disabled.