From 64b2005beb446703f292e48c6c08683a745e3b92 Mon Sep 17 00:00:00 2001 From: Aaro Varis Date: Sun, 16 Mar 2025 14:31:11 +0200 Subject: [PATCH] mm --- BoneSync/Sync/Components/SyncableNetworking.cs | 13 ++++++------- BoneSync/Sync/Components/SyncablePhysics.cs | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/BoneSync/Sync/Components/SyncableNetworking.cs b/BoneSync/Sync/Components/SyncableNetworking.cs index 7ce9b6c..5001172 100644 --- a/BoneSync/Sync/Components/SyncableNetworking.cs +++ b/BoneSync/Sync/Components/SyncableNetworking.cs @@ -46,16 +46,10 @@ namespace BoneSync.Sync.Components { SyncLogger.Msg("Setting owner for " + _syncId + " to " + ownerId); _ownerId = ownerId; - if (!isOwner) - { - _simpleEventQueue.Clear(); - } else - { - TryCatchUpSimpleEvents(); - } FindAndUpdateComponents(); MelonCoroutines.Start(SyncCoroutineAsync()); UpdateKinematic(); + TryCatchUpSimpleEvents(); } public bool ClientSpawningAllowed() @@ -149,6 +143,11 @@ namespace BoneSync.Sync.Components private void TryCatchUpSimpleEvents() { + if (Registered && !isOwner) + { + _simpleEventQueue.Clear(); + return; + } if (_simpleEventQueue.Count > 0 && Registered && isOwner) { byte[] eventData = _simpleEventQueue.Dequeue(); diff --git a/BoneSync/Sync/Components/SyncablePhysics.cs b/BoneSync/Sync/Components/SyncablePhysics.cs index 839be59..1951d2a 100644 --- a/BoneSync/Sync/Components/SyncablePhysics.cs +++ b/BoneSync/Sync/Components/SyncablePhysics.cs @@ -25,7 +25,7 @@ namespace BoneSync.Sync.Components byte index = (byte)Array.IndexOf(buttonToggles, toggle); RegisterSyncable(); if (!isOwner && Registered) return false; - AddSimpleEventToQueue(eventType, index); + AddSimpleEventToQueue(eventType, index, (byte)buttonToggles.Length); return true; } bool ButtonOnPress(ButtonToggle toggle)