From 1658bb8fcb7a46cb3311f0f58941d113415511b7 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 17 Nov 2022 16:47:02 -0800 Subject: [PATCH] make it so only owner can do thing --- .../AlarmTotemSync/Patches/AlarmTotemPatches.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/QSB/EchoesOfTheEye/AlarmTotemSync/Patches/AlarmTotemPatches.cs b/QSB/EchoesOfTheEye/AlarmTotemSync/Patches/AlarmTotemPatches.cs index 77633be2..8b84d710 100644 --- a/QSB/EchoesOfTheEye/AlarmTotemSync/Patches/AlarmTotemPatches.cs +++ b/QSB/EchoesOfTheEye/AlarmTotemSync/Patches/AlarmTotemPatches.cs @@ -77,6 +77,12 @@ public class AlarmTotemPatches : QSBPatch { return true; } + var qsbAlarmTotem = __instance.GetWorldObject(); + + if (qsbAlarmTotem.Owner != QSBPlayerManager.LocalPlayerId) + { + return false; + } var isPlayerVisible = __instance._isPlayerVisible; __instance._isPlayerVisible = __instance.CheckPlayerVisible(); @@ -88,7 +94,7 @@ public class AlarmTotemPatches : QSBPatch __instance._simTotemRenderer.sharedMaterials = __instance._simTotemMaterials; __instance._simVisionConeRenderer.SetColor(__instance._simAlarmColor); GlobalMessenger.FireEvent("AlarmTotemTriggered"); - __instance.GetWorldObject().SendMessage(new SetVisibleMessage(true)); + qsbAlarmTotem.SendMessage(new SetVisibleMessage(true)); } else if (isPlayerVisible && !__instance._isPlayerVisible) { @@ -98,7 +104,7 @@ public class AlarmTotemPatches : QSBPatch __instance._simTotemRenderer.sharedMaterials = __instance._simTotemMaterials; __instance._simVisionConeRenderer.SetColor(__instance._simVisionConeRenderer.GetOriginalColor()); __instance._pulseLightController.FadeTo(0f, 0.5f); - __instance.GetWorldObject().SendMessage(new SetVisibleMessage(false)); + qsbAlarmTotem.SendMessage(new SetVisibleMessage(false)); } return false; }