mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-04-16 05:42:52 +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.Utility;
|
||||||
using QSB.WorldSync;
|
using QSB.WorldSync;
|
||||||
using System;
|
using System;
|
||||||
|
using QSB.ShipSync.TransformSync;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace QSB.ShipSync.Patches
|
namespace QSB.ShipSync.Patches
|
||||||
@ -206,14 +207,7 @@ namespace QSB.ShipSync.Patches
|
|||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(ShipDamageController), nameof(ShipDamageController.OnImpact))]
|
[HarmonyPatch(typeof(ShipDamageController), nameof(ShipDamageController.OnImpact))]
|
||||||
public static bool ShipDamageController_OnImpact()
|
public static bool ShipDamageController_OnImpact()
|
||||||
{
|
=> ShipTransformSync.LocalInstance == null || ShipManager.Instance.HasAuthority;
|
||||||
if (!ShipManager.Instance)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ShipManager.Instance.HasAuthority;
|
|
||||||
}
|
|
||||||
|
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
[HarmonyPatch(typeof(ShipComponent), nameof(ShipComponent.RepairTick))]
|
[HarmonyPatch(typeof(ShipComponent), nameof(ShipComponent.RepairTick))]
|
||||||
|
@ -13,7 +13,9 @@ namespace QSB.TornadoSync.TransformSync
|
|||||||
{
|
{
|
||||||
public class OccasionalTransformSync : UnsectoredRigidbodySync
|
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 UseInterpolation => false;
|
||||||
public override bool IsPlayerObject => false;
|
public override bool IsPlayerObject => false;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user