set LocalInstance in Start to attempt to alleviate some bs

This commit is contained in:
JohnCorby 2022-01-18 10:30:34 -08:00
parent eb3929a5bb
commit 4604830ecf
2 changed files with 6 additions and 4 deletions

View File

@ -43,11 +43,13 @@ namespace QSB.Player.TransformSync
private Transform GetStickPivot()
=> QSBWorldSync.GetUnityObjects<RoastingStickController>().First().transform.Find("Stick_Root/Stick_Pivot");
public override void OnStartLocalPlayer()
=> LocalInstance = this;
public override void Start()
{
if (isLocalPlayer)
{
LocalInstance = this;
}
var player = new PlayerInfo(this);
QSBPlayerManager.PlayerList.SafeAdd(player);
base.Start();

View File

@ -26,7 +26,7 @@ namespace QSB.Syncs
{
if (_player == null)
{
DebugLog.ToConsole("Error - trying to get SyncBase.Player before Start has been called! "
DebugLog.ToConsole($"Error - trying to get SyncBase.Player for {netId} before Start has been called! "
+ "this really should not be happening!\n"
+ $"{Environment.StackTrace}",
MessageType.Error);