Ведь без тебя нет смысла жить

This commit is contained in:
Remuchi
2024-03-28 00:35:43 +07:00
parent fa18556a8f
commit face21c33a
8 changed files with 28 additions and 54 deletions

View File

@@ -14,20 +14,10 @@ public sealed class AirlockSystem : SharedAirlockSystem
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<AirlockComponent, BeforeDoorClosedEvent>(OnBeforeDoorClosed);
SubscribeLocalEvent<AirlockComponent, ComponentStartup>(OnComponentStartup);
SubscribeLocalEvent<AirlockComponent, AppearanceChangeEvent>(OnAppearanceChange);
}
// А нужен ли ты блять
private void OnBeforeDoorClosed(EntityUid uid, AirlockComponent airlock, BeforeDoorClosedEvent args)
{
if (_appearanceSystem.TryGetData<bool>(uid, DoorVisuals.BoltLights, out var boltLights) && boltLights)
{
args.Cancel();
}
}
private void OnComponentStartup(EntityUid uid, AirlockComponent comp, ComponentStartup args)
{
// Has to be on component startup because we don't know what order components initialize in and running this before DoorComponent inits _will_ crash.