From 71cba8cca3d6fc0dd7442cec5be6e72ccec12643 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Wed, 10 Nov 2021 01:20:16 -0800 Subject: [PATCH] new lines between methods --- QSB/Anglerfish/Events/AnglerChangeStateEvent.cs | 3 +++ QSB/Anglerfish/Events/AnglerChangeStateMessage.cs | 1 + QSB/Anglerfish/TransformSync/AnglerTransformSync.cs | 2 ++ QSB/Anglerfish/WorldObjects/QSBAngler.cs | 1 + 4 files changed, 7 insertions(+) diff --git a/QSB/Anglerfish/Events/AnglerChangeStateEvent.cs b/QSB/Anglerfish/Events/AnglerChangeStateEvent.cs index 8ca9574e..7c5b5045 100644 --- a/QSB/Anglerfish/Events/AnglerChangeStateEvent.cs +++ b/QSB/Anglerfish/Events/AnglerChangeStateEvent.cs @@ -13,6 +13,7 @@ namespace QSB.Anglerfish.Events public override EventType Type => EventType.AnglerChangeState; public override void SetupListener() => GlobalMessenger.AddListener(EventNames.QSBAnglerChangeState, Handler); public override void CloseListener() => GlobalMessenger.RemoveListener(EventNames.QSBAnglerChangeState, Handler); + private void Handler(QSBAngler qsbAngler) => SendEvent(new AnglerChangeStateMessage { @@ -24,6 +25,7 @@ namespace QSB.Anglerfish.Events public override void OnReceiveLocal(bool isHost, AnglerChangeStateMessage message) => OnReceive(isHost, message); public override void OnReceiveRemote(bool isHost, AnglerChangeStateMessage message) => OnReceive(isHost, message); + private static void OnReceive(bool isHost, AnglerChangeStateMessage message) { var qsbAngler = QSBWorldSync.GetWorldFromId(message.ObjectId); @@ -51,6 +53,7 @@ namespace QSB.Anglerfish.Events } return QSBPlayerManager.LocalPlayerId; } + private static Transform IdToTarget(uint id) { if (id == uint.MaxValue) diff --git a/QSB/Anglerfish/Events/AnglerChangeStateMessage.cs b/QSB/Anglerfish/Events/AnglerChangeStateMessage.cs index 75eb26f7..9a5a40cd 100644 --- a/QSB/Anglerfish/Events/AnglerChangeStateMessage.cs +++ b/QSB/Anglerfish/Events/AnglerChangeStateMessage.cs @@ -15,6 +15,7 @@ namespace QSB.Anglerfish.Events targetId = reader.ReadUInt32(); localDisturbancePos = reader.ReadVector3(); } + public override void Serialize(QNetworkWriter writer) { base.Serialize(writer); diff --git a/QSB/Anglerfish/TransformSync/AnglerTransformSync.cs b/QSB/Anglerfish/TransformSync/AnglerTransformSync.cs index fd5528f1..ccaefed7 100644 --- a/QSB/Anglerfish/TransformSync/AnglerTransformSync.cs +++ b/QSB/Anglerfish/TransformSync/AnglerTransformSync.cs @@ -14,11 +14,13 @@ namespace QSB.Anglerfish.TransformSync private QSBAngler _qsbAngler; private static readonly List _instances = new List(); + public override void Start() { _instances.Add(this); base.Start(); } + protected override void OnDestroy() { _instances.Remove(this); diff --git a/QSB/Anglerfish/WorldObjects/QSBAngler.cs b/QSB/Anglerfish/WorldObjects/QSBAngler.cs index 67705fd4..5eff4a34 100644 --- a/QSB/Anglerfish/WorldObjects/QSBAngler.cs +++ b/QSB/Anglerfish/WorldObjects/QSBAngler.cs @@ -54,6 +54,7 @@ namespace QSB.Anglerfish.WorldObjects public Transform targetTransform; public Vector3 TargetVelocity { get; private set; } private Vector3 _lastTargetPosition; + public void FixedUpdate() { if (targetTransform == null)