mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-20 15:41:01 +00:00
alarm totem: enabled sync
This commit is contained in:
parent
013d29b7a5
commit
5e611a4bf0
@ -33,4 +33,26 @@ public class AlarmTotemPatches : QSBPatch
|
||||
__instance.GetWorldObject<QSBAlarmTotem>()
|
||||
.SendMessage(new SetFaceOpenMessage(open));
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(AlarmTotem), nameof(AlarmTotem.OnSectorOccupantAdded))]
|
||||
private static void OnSectorOccupantAdded(AlarmTotem __instance, SectorDetector sectorDetector)
|
||||
{
|
||||
if (sectorDetector.GetOccupantType() == DynamicOccupant.Player && QSBWorldSync.AllObjectsAdded)
|
||||
{
|
||||
__instance.GetWorldObject<QSBAlarmTotem>()
|
||||
.SendMessage(new SetEnabledMessage(true));
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(AlarmTotem), nameof(AlarmTotem.OnSectorOccupantRemoved))]
|
||||
private static void OnSectorOccupantRemoved(AlarmTotem __instance, SectorDetector sectorDetector)
|
||||
{
|
||||
if (sectorDetector.GetOccupantType() == DynamicOccupant.Player && QSBWorldSync.AllObjectsAdded)
|
||||
{
|
||||
__instance.GetWorldObject<QSBAlarmTotem>()
|
||||
.SendMessage(new SetEnabledMessage(false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user