mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-19 06:28:40 +03:00
* mass clean up
(cherry picked from commit 12bb873b02c1ef50e20763542b030452cc0613da)
* Revert "Centrifuge buff (#393)"
This reverts commit 2a59a18230.
(cherry picked from commit 9ee495ab4bb365e1ccd3dc627ecb55114fea6944)
* Shoving merge conflict
* fix rich traitor
* fix test
* yml
* fix test
* fix test
* ohh
27 lines
939 B
C#
27 lines
939 B
C#
using Content.Shared._White.RemoteControl.Components;
|
|
using Content.Shared.Mobs;
|
|
|
|
namespace Content.Server._White.RemoteControl.Systems;
|
|
|
|
public partial class RemoteControlSystem
|
|
{
|
|
private void InitializeUser()
|
|
{
|
|
SubscribeLocalEvent<RemoteControlUserComponent, ComponentShutdown>(OnUserShutdown);
|
|
|
|
SubscribeLocalEvent<RemoteControlUserComponent, MobStateChangedEvent>(OnUserMobStateChanged);
|
|
}
|
|
|
|
private void OnUserShutdown(EntityUid uid, RemoteControlUserComponent comp, ComponentShutdown args)
|
|
{
|
|
if (TryComp<RemoteControlTargetComponent>(comp.Target, out var targetComp) && targetComp.User == uid)
|
|
EndRemoteControl((uid, comp), (comp.Target, targetComp));
|
|
}
|
|
|
|
private void OnUserMobStateChanged(EntityUid uid, RemoteControlUserComponent comp, MobStateChangedEvent args)
|
|
{
|
|
if (args.NewMobState != MobState.Alive)
|
|
EndRemoteControl((uid, comp));
|
|
}
|
|
}
|