From 456ccfc8582650ae36ac8395802ff98b1538a12d Mon Sep 17 00:00:00 2001 From: Julian Giebel Date: Sat, 16 Apr 2022 00:51:56 +0200 Subject: [PATCH] Add flash immunity to welding masks (#7561) --- Content.Server/Flash/FlashSystem.cs | 7 +++++-- Resources/Prototypes/Entities/Clothing/Head/welding.yml | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Content.Server/Flash/FlashSystem.cs b/Content.Server/Flash/FlashSystem.cs index eef7501242..227613f453 100644 --- a/Content.Server/Flash/FlashSystem.cs +++ b/Content.Server/Flash/FlashSystem.cs @@ -210,9 +210,12 @@ namespace Content.Server.Flash private void OnInventoryFlashAttempt(EntityUid uid, InventoryComponent component, FlashAttemptEvent args) { + // Forward the event to a worn helmet, if one is equipped. + if (_inventorySystem.TryGetSlotEntity(uid, "head", out var maskSlotEntity, component)) + RaiseLocalEvent(maskSlotEntity.Value, args); // Forward the event to the glasses, if any. - if(_inventorySystem.TryGetSlotEntity(uid, "eyes", out var slotEntity, component)) - RaiseLocalEvent(slotEntity.Value, args); + if(!args.Cancelled && _inventorySystem.TryGetSlotEntity(uid, "eyes", out var eyeSlotEntity, component)) + RaiseLocalEvent(eyeSlotEntity.Value, args); } private void OnFlashImmunityFlashAttempt(EntityUid uid, FlashImmunityComponent component, FlashAttemptEvent args) diff --git a/Resources/Prototypes/Entities/Clothing/Head/welding.yml b/Resources/Prototypes/Entities/Clothing/Head/welding.yml index ba2ab93044..b92e129092 100644 --- a/Resources/Prototypes/Entities/Clothing/Head/welding.yml +++ b/Resources/Prototypes/Entities/Clothing/Head/welding.yml @@ -5,6 +5,7 @@ abstract: true components: - type: IngestionBlocker + - type: FlashImmunity - type: entity parent: WeldingMaskBase