mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-03-02 19:13:34 +00:00
make body indexes actually work
This commit is contained in:
parent
41af623ded
commit
e69c74ae66
@ -20,7 +20,7 @@ namespace QSB.TornadoSync.TransformSync
|
||||
public void InitBodyIndexes(OWRigidbody body, OWRigidbody refBody)
|
||||
{
|
||||
_bodyIndex = CenterOfTheUniverse.s_rigidbodies.IndexOf(body);
|
||||
_bodyIndex = CenterOfTheUniverse.s_rigidbodies.IndexOf(refBody);
|
||||
_refBodyIndex = CenterOfTheUniverse.s_rigidbodies.IndexOf(refBody);
|
||||
}
|
||||
|
||||
public override float GetNetworkSendInterval() => 1;
|
||||
@ -30,8 +30,8 @@ namespace QSB.TornadoSync.TransformSync
|
||||
base.Init();
|
||||
SetReferenceTransform(CenterOfTheUniverse.s_rigidbodies[_refBodyIndex].transform);
|
||||
|
||||
// to prevent change in vel/angvel
|
||||
if (AttachedObject.TryGetComponent<AlignWithDirection>(out var align) && !HasAuthority)
|
||||
// to prevent change in rotation/angvel
|
||||
if (!HasAuthority && AttachedObject.TryGetComponent<AlignWithDirection>(out var align))
|
||||
{
|
||||
align.enabled = false;
|
||||
}
|
||||
@ -54,17 +54,17 @@ namespace QSB.TornadoSync.TransformSync
|
||||
{
|
||||
base.DeserializeTransform(reader, initialState);
|
||||
|
||||
if (!WorldObjectManager.AllObjectsReady || HasAuthority)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (initialState)
|
||||
{
|
||||
_bodyIndex = reader.ReadInt32();
|
||||
_refBodyIndex = reader.ReadInt32();
|
||||
}
|
||||
|
||||
if (!WorldObjectManager.AllObjectsReady || HasAuthority)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_shouldUpdate = true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user