add more null checks

This commit is contained in:
_nebula 2023-07-04 21:56:40 +01:00
parent 6099fa5fd1
commit 2889bffb16
3 changed files with 9 additions and 3 deletions

View File

@ -13,7 +13,13 @@ public class ShipThrusterAudioOneShotMessage : QSBMessage<(AudioType audioType,
public override void OnReceiveRemote()
{
var source = ShipManager.Instance.ShipThrusterAudio._rotationalSource;
var source = ShipManager.Instance?.ShipThrusterAudio?._rotationalSource;
if (source == null)
{
return;
}
source.pitch = Data.pitch;
source.PlayOneShot(Data.audioType, Data.volume);
}

View File

@ -8,7 +8,7 @@ using QSB.WorldSync;
namespace QSB.ShipSync.Patches;
[HarmonyPatch(typeof(ShipDetachableModule))]
internal class ShipDetachableModulePatches : QSBPatch
public class ShipDetachableModulePatches : QSBPatch
{
public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect;

View File

@ -8,7 +8,7 @@ using UnityEngine;
namespace QSB.ShipSync.Patches;
internal class ShipFlameWashPatches : QSBPatch
public class ShipFlameWashPatches : QSBPatch
{
public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect;