From 862d6949c02e5f7004ade129d99c905d076ef13c Mon Sep 17 00:00:00 2001 From: Aleksander Waage Date: Sun, 23 Aug 2020 20:33:28 +0200 Subject: [PATCH] playerid --- QSB/PlayerRegistry.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/QSB/PlayerRegistry.cs b/QSB/PlayerRegistry.cs index c501d297..979215ca 100644 --- a/QSB/PlayerRegistry.cs +++ b/QSB/PlayerRegistry.cs @@ -4,6 +4,7 @@ using QSB.TransformSync; using QSB.Utility; using System.Collections.Generic; using System.Linq; +using UnityEngine.Networking; namespace QSB { @@ -11,7 +12,7 @@ namespace QSB { public const int NetworkObjectCount = 4; - public static uint LocalPlayerId => PlayerTransformSync.LocalInstance.netId.Value; + public static uint LocalPlayerId => PlayerTransformSync.LocalInstance.GetComponent()?.netId.Value ?? 0; public static PlayerInfo LocalPlayer => GetPlayer(LocalPlayerId); public static List PlayerList { get; } = new List();