mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 03:32:38 +00:00
wait a frame
This commit is contained in:
parent
58e1c70c33
commit
b1a4b357d5
@ -180,32 +180,34 @@ namespace QSB.QuantumSync.WorldObjects
|
||||
((IQSBQuantumObject)this).SendMessage(new QuantumAuthorityMessage(QSBPlayerManager.LocalPlayerId));
|
||||
}
|
||||
|
||||
private void OnDisable(Shape s)
|
||||
{
|
||||
if (!IsEnabled)
|
||||
private void OnDisable(Shape s) =>
|
||||
// we wait a frame here in case the shapes get disabled as we switch from 1 visibility tracker to another
|
||||
QSBCore.UnityEvents.FireOnNextUpdate(() =>
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!IsEnabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetAttachedShapes().Any(x => x.isActiveAndEnabled))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (GetAttachedShapes().Any(x => x.isActiveAndEnabled))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IsEnabled = false;
|
||||
if (!WorldObjectManager.AllObjectsReady && !QSBCore.IsHost)
|
||||
{
|
||||
return;
|
||||
}
|
||||
IsEnabled = false;
|
||||
if (!WorldObjectManager.AllObjectsReady && !QSBCore.IsHost)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (ControllingPlayer != QSBPlayerManager.LocalPlayerId)
|
||||
{
|
||||
// not being controlled by us, don't care if we leave area
|
||||
return;
|
||||
}
|
||||
if (ControllingPlayer != QSBPlayerManager.LocalPlayerId)
|
||||
{
|
||||
// not being controlled by us, don't care if we leave area
|
||||
return;
|
||||
}
|
||||
|
||||
// send event to other players that we're releasing authority
|
||||
((IQSBQuantumObject)this).SendMessage(new QuantumAuthorityMessage(0u));
|
||||
}
|
||||
// send event to other players that we're releasing authority
|
||||
((IQSBQuantumObject)this).SendMessage(new QuantumAuthorityMessage(0u));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user