This commit is contained in:
Aaro Varis
2025-03-16 14:31:11 +02:00
parent 922c33d4a1
commit 64b2005beb
2 changed files with 7 additions and 8 deletions

View File

@@ -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();

View File

@@ -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)