File tree Expand file tree Collapse file tree 4 files changed +16
-5
lines changed
Expand file tree Collapse file tree 4 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ internal static void Register()
4949
5050 PlayerEvents . TriggeringTesla += OnPlayerEvent ;
5151 PlayerEvents . InteractingElevator += OnPlayerEvent ;
52+ PlayerEvents . InteractingDoor += OnOpenDoor ;
5253 PlayerEvents . Hurting += OnHurting ;
5354 PlayerEvents . Cuffing += OnHandcuffing ;
5455 PlayerEvents . Left += OnLeft ;
@@ -72,6 +73,7 @@ internal static void Unregister()
7273
7374 PlayerEvents . TriggeringTesla -= OnPlayerEvent ;
7475 PlayerEvents . InteractingElevator -= OnPlayerEvent ;
76+ PlayerEvents . InteractingDoor -= OnOpenDoor ;
7577 PlayerEvents . Hurting -= OnHurting ;
7678 PlayerEvents . Cuffing -= OnHandcuffing ;
7779 PlayerEvents . Left -= OnLeft ;
@@ -235,4 +237,12 @@ private static void OnVoiceChatting(IPlayerEvent ev)
235237 cancellableEvent . IsAllowed = false ;
236238 }
237239 }
240+
241+ private static void OnOpenDoor ( PlayerInteractingDoorEventArgs ev )
242+ {
243+ if ( CameraManager . Instance . IsWatching ( ev . Player ) )
244+ {
245+ ev . IsAllowed = false ;
246+ }
247+ }
238248}
Original file line number Diff line number Diff line change @@ -44,11 +44,11 @@ internal void Connect(Player player)
4444
4545 internal void Disconnect ( Player player , DamageHandlerBase damageHandler = null )
4646 {
47- if ( ! TryGetWatcher ( player , out var watcher ) || watcher . Player . IsOnline )
47+ if ( ! TryGetWatcher ( player , out var watcher ) || watcher . Player . IsOffline )
4848 {
4949 return ;
5050 }
51-
51+
5252 try
5353 {
5454 watcher . Player . SetRole ( watcher . PlayerSnapshot . Role , flags : RoleSpawnFlags . None ) ;
Original file line number Diff line number Diff line change 22using MEC ;
33using Mirror ;
44using NetworkManagerUtils . Dummies ;
5+ using UnityEngine ;
56
67namespace CameraSystem . Models ;
78
@@ -32,7 +33,7 @@ private ReferenceHub SpawnNpc()
3233 var hub = DummyUtils . SpawnDummy ( PlayerSnapshot . Nickname ) ;
3334 var npcPlayer = Player . Get ( hub ) ;
3435 npcPlayer . SetRole ( PlayerSnapshot . Role ) ;
35- npcPlayer . Position = PlayerSnapshot . Position ;
36+ npcPlayer . Position = PlayerSnapshot . Position + Vector3 . up * 0.1f ;
3637
3738 var newCustomInfo = PlayerSnapshot . CustomInfo +
3839 CameraSystem . Instance . Config ? . Translations . WatchingCamerasPostfix ;
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ public static class WorkstationActivationPatch
99{
1010 [ HarmonyPrefix ]
1111 // ReSharper disable once InconsistentNaming
12- public static void OnEnterWorkstation ( ReferenceHub ply , WorkstationController __instance )
12+ public static bool OnEnterWorkstation ( ReferenceHub ply , WorkstationController __instance )
1313 {
14- EventHandlers . OnActivatingWorkstation ( Player . Get ( ply ) , __instance ) ;
14+ return EventHandlers . OnActivatingWorkstation ( Player . Get ( ply ) , __instance ) ;
1515 }
1616}
You can’t perform that action at this time.
0 commit comments