From b4ecf8a7ec072ab7b6dac6a2e8904ad4128b714e Mon Sep 17 00:00:00 2001 From: themias <89101928+themias@users.noreply.github.com> Date: Wed, 15 Jun 2022 03:04:52 -0400 Subject: [PATCH] Syndicate gas mask flash protection (#8818) * Syndicate gas masks protect from flashbangs * fix var name * update to loop through all slots * update based on review comments --- Content.Server/Flash/FlashSystem.cs | 13 +++++++------ .../Prototypes/Entities/Clothing/Masks/masks.yml | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Content.Server/Flash/FlashSystem.cs b/Content.Server/Flash/FlashSystem.cs index e3df2eb3e0..a8ababd66b 100644 --- a/Content.Server/Flash/FlashSystem.cs +++ b/Content.Server/Flash/FlashSystem.cs @@ -195,12 +195,13 @@ 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(!args.Cancelled && _inventorySystem.TryGetSlotEntity(uid, "eyes", out var eyeSlotEntity, component)) - RaiseLocalEvent(eyeSlotEntity.Value, args); + foreach (var slot in new string[]{"head", "eyes", "mask"}) + { + if (args.Cancelled) + break; + if (_inventorySystem.TryGetSlotEntity(uid, slot, out var item, component)) + RaiseLocalEvent(item.Value, args); + } } private void OnFlashImmunityFlashAttempt(EntityUid uid, FlashImmunityComponent component, FlashAttemptEvent args) diff --git a/Resources/Prototypes/Entities/Clothing/Masks/masks.yml b/Resources/Prototypes/Entities/Clothing/Masks/masks.yml index 82efdc12b0..ef5d73db85 100644 --- a/Resources/Prototypes/Entities/Clothing/Masks/masks.yml +++ b/Resources/Prototypes/Entities/Clothing/Masks/masks.yml @@ -42,6 +42,7 @@ - type: IngestionBlocker - type: DiseaseProtection protection: 0.05 + - type: FlashImmunity - type: entity parent: ClothingMaskBase