mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-04 02:47:22 +00:00
probe body doesn't exist on statue scene reload
This commit is contained in:
parent
03cc8a84a0
commit
a10c850a67
@ -14,16 +14,6 @@ namespace QSB.TornadoSync
|
|||||||
{
|
{
|
||||||
QSBWorldSync.Init<QSBTornado, TornadoController>();
|
QSBWorldSync.Init<QSBTornado, TornadoController>();
|
||||||
|
|
||||||
if (QSBCore.IsHost)
|
|
||||||
{
|
|
||||||
foreach (var transformSync in QSBWorldSync.GetUnityObjects<OccasionalTransformSync>())
|
|
||||||
{
|
|
||||||
NetworkServer.Destroy(transformSync.gameObject);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
OccasionalTransformSync.Bodies.Clear();
|
|
||||||
|
|
||||||
var gdBody = Locator._giantsDeep.GetOWRigidbody();
|
var gdBody = Locator._giantsDeep.GetOWRigidbody();
|
||||||
// cannon
|
// cannon
|
||||||
var cannon = Locator._orbitalProbeCannon.GetRequiredComponent<OrbitalProbeLaunchController>();
|
var cannon = Locator._orbitalProbeCannon.GetRequiredComponent<OrbitalProbeLaunchController>();
|
||||||
@ -33,7 +23,10 @@ namespace QSB.TornadoSync
|
|||||||
SpawnOccasional(proxy.transform.root.GetAttachedOWRigidbody(), gdBody);
|
SpawnOccasional(proxy.transform.root.GetAttachedOWRigidbody(), gdBody);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cannon._probeBody)
|
||||||
|
{
|
||||||
SpawnOccasional(cannon._probeBody, gdBody);
|
SpawnOccasional(cannon._probeBody, gdBody);
|
||||||
|
}
|
||||||
|
|
||||||
// islands
|
// islands
|
||||||
foreach (var island in QSBWorldSync.GetUnityObjects<IslandController>().SortDeterministic())
|
foreach (var island in QSBWorldSync.GetUnityObjects<IslandController>().SortDeterministic())
|
||||||
@ -42,6 +35,19 @@ namespace QSB.TornadoSync
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void UnbuildWorldObjects()
|
||||||
|
{
|
||||||
|
if (QSBCore.IsHost)
|
||||||
|
{
|
||||||
|
foreach (var transformSync in QSBWorldSync.GetUnityObjects<OccasionalTransformSync>())
|
||||||
|
{
|
||||||
|
NetworkServer.Destroy(transformSync.gameObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
OccasionalTransformSync.Bodies.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
private static void SpawnOccasional(OWRigidbody body, OWRigidbody refBody)
|
private static void SpawnOccasional(OWRigidbody body, OWRigidbody refBody)
|
||||||
{
|
{
|
||||||
OccasionalTransformSync.Bodies.Add((body, refBody));
|
OccasionalTransformSync.Bodies.Add((body, refBody));
|
||||||
|
Loading…
Reference in New Issue
Block a user