mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-21 09:39:56 +00:00
fixed OccasionalTransformSync NRE
This commit is contained in:
parent
589750649f
commit
16592d4d57
@ -5,6 +5,7 @@ using QSB.Patches;
|
||||
using QSB.Utility;
|
||||
using QSB.WorldSync;
|
||||
using System;
|
||||
using QSB.ShipSync.TransformSync;
|
||||
using UnityEngine;
|
||||
|
||||
namespace QSB.ShipSync.Patches
|
||||
@ -206,14 +207,7 @@ namespace QSB.ShipSync.Patches
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(ShipDamageController), nameof(ShipDamageController.OnImpact))]
|
||||
public static bool ShipDamageController_OnImpact()
|
||||
{
|
||||
if (!ShipManager.Instance)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return ShipManager.Instance.HasAuthority;
|
||||
}
|
||||
=> ShipTransformSync.LocalInstance == null || ShipManager.Instance.HasAuthority;
|
||||
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(ShipComponent), nameof(ShipComponent.RepairTick))]
|
||||
|
@ -13,7 +13,9 @@ namespace QSB.TornadoSync.TransformSync
|
||||
{
|
||||
public class OccasionalTransformSync : UnsectoredRigidbodySync
|
||||
{
|
||||
public override bool IsReady => WorldObjectManager.AllObjectsReady;
|
||||
public override bool IsReady => WorldObjectManager.AllObjectsReady
|
||||
&& _bodyIndex >= 0 && _bodyIndex < CenterOfTheUniverse.s_rigidbodies.Count
|
||||
&& _refBodyIndex >= 0 && _refBodyIndex < CenterOfTheUniverse.s_rigidbodies.Count;
|
||||
public override bool UseInterpolation => false;
|
||||
public override bool IsPlayerObject => false;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user