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)