From 6dc11d05ce18354f9fe1572395ee91c2b233d359 Mon Sep 17 00:00:00 2001 From: Aleksander Waage Date: Wed, 19 Aug 2020 22:29:53 +0200 Subject: [PATCH] tiny fixes --- QSB/QSB.cs | 4 +--- QSB/QSBNetworkManager.cs | 6 +----- QSB/TransformSync/PlayerTransformSync.cs | 1 + QSB/TransformSync/ShipTransformSync.cs | 1 + QSB/Utility/DebugLog.cs | 15 +++++++-------- 5 files changed, 11 insertions(+), 16 deletions(-) diff --git a/QSB/QSB.cs b/QSB/QSB.cs index 9366b0bc..fd172a11 100644 --- a/QSB/QSB.cs +++ b/QSB/QSB.cs @@ -15,7 +15,6 @@ namespace QSB public static string DefaultServerIP; public static bool DebugMode; public static AssetBundle NetworkAssetBundle; - private static GameObject GameObject; private void Awake() { @@ -25,10 +24,9 @@ namespace QSB private void Start() { Helper = ModHelper; - GameObject = gameObject; NetworkAssetBundle = Helper.Assets.LoadBundle("assets/network"); - QSB.Helper.HarmonyHelper.EmptyMethod("Update"); + Helper.HarmonyHelper.EmptyMethod("Update"); gameObject.AddComponent(); gameObject.AddComponent(); diff --git a/QSB/QSBNetworkManager.cs b/QSB/QSBNetworkManager.cs index 9dff17a6..5c7bc28b 100644 --- a/QSB/QSBNetworkManager.cs +++ b/QSB/QSBNetworkManager.cs @@ -150,13 +150,9 @@ namespace QSB public void CleanupNetworkBehaviour(uint netId) { var networkBehaviours = FindObjectsOfType() - .Where(x => x.netId.Value == netId); + .Where(x => x != null && x.netId.Value == netId); foreach (var networkBehaviour in networkBehaviours) { - if (networkBehaviour == null) - { - continue; - } var transformSync = networkBehaviour.GetComponent(); if (transformSync != null) diff --git a/QSB/TransformSync/PlayerTransformSync.cs b/QSB/TransformSync/PlayerTransformSync.cs index da6b45be..a9d22581 100644 --- a/QSB/TransformSync/PlayerTransformSync.cs +++ b/QSB/TransformSync/PlayerTransformSync.cs @@ -20,6 +20,7 @@ namespace QSB.TransformSync { LocalInstance = this; } + private Transform GetPlayerModel() { return Locator.GetPlayerTransform().Find("Traveller_HEA_Player_v2"); diff --git a/QSB/TransformSync/ShipTransformSync.cs b/QSB/TransformSync/ShipTransformSync.cs index 2cdedc3b..c41fd515 100644 --- a/QSB/TransformSync/ShipTransformSync.cs +++ b/QSB/TransformSync/ShipTransformSync.cs @@ -14,6 +14,7 @@ namespace QSB.TransformSync { LocalInstance = this; } + private Transform GetShipModel() { return Locator.GetShipTransform(); diff --git a/QSB/Utility/DebugLog.cs b/QSB/Utility/DebugLog.cs index 576965a7..aeed0880 100644 --- a/QSB/Utility/DebugLog.cs +++ b/QSB/Utility/DebugLog.cs @@ -29,23 +29,22 @@ namespace QSB.Utility ToHud(message); } - public static string GenerateTable(List collumsData, List rowData) + public static string GenerateTable(List columnsData, List rowData) { - var longestKey = collumsData.OrderByDescending(s => s.Length).First(); + var longestKey = columnsData.OrderByDescending(s => s.Length).First(); var longestValue = rowData.OrderByDescending(s => s.Length).First(); var longestObject = (longestKey.Length > longestValue.Length) ? longestKey : longestValue; - string collums = "|"; - string data = "|"; - foreach (var item in collumsData) + var columns = "|"; + var data = "|"; + foreach (var item in columnsData) { - collums += " " + item.PadRight(longestObject.Length) + " |"; - + columns += " " + item.PadRight(longestObject.Length) + " |"; } foreach (var item in rowData) { data += " " + item.PadRight(longestObject.Length) + " |"; } - return collums + Environment.NewLine + data; + return columns + Environment.NewLine + data; } } }