mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-17 01:13:05 +00:00
dont trigger mind stuff if a remote player is projecting
This commit is contained in:
parent
eeadd3ff4f
commit
ffeb5e7a37
@ -9,6 +9,7 @@ public class VisionTorchProjectMessage : QSBWorldObjectMessage<QSBVisionTorchIte
|
||||
public override void OnReceiveRemote()
|
||||
{
|
||||
WorldObject.AttachedObject._isProjecting = Data;
|
||||
WorldObject.IsProjectingRemotely = Data;
|
||||
WorldObject.AttachedObject._mindProjectorTrigger.SetProjectorActive(Data);
|
||||
}
|
||||
}
|
||||
|
@ -42,4 +42,22 @@ public class VisionTorchPatches : QSBPatch
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(MindProjectorTrigger), nameof(MindProjectorTrigger.OnTriggerVolumeEntry))]
|
||||
private static bool OnTriggerVolumeEntry(MindProjectorTrigger __instance)
|
||||
{
|
||||
if (!QSBWorldSync.AllObjectsReady)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
var visionTorchItem = __instance.GetComponentInParent<VisionTorchItem>();
|
||||
if (visionTorchItem && visionTorchItem.GetWorldObject<QSBVisionTorchItem>().IsProjectingRemotely)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,8 @@ namespace QSB.EchoesOfTheEye.VisionTorch.WorldObjects;
|
||||
|
||||
public class QSBVisionTorchItem : QSBItem<VisionTorchItem>
|
||||
{
|
||||
public bool IsProjectingRemotely;
|
||||
|
||||
public override void SendInitialState(uint to)
|
||||
{
|
||||
this.SendMessage(new VisionTorchProjectMessage(AttachedObject._isProjecting) { To = to });
|
||||
|
Loading…
Reference in New Issue
Block a user