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
This commit is contained in:
themias
2022-06-15 03:04:52 -04:00
committed by GitHub
parent c243edbf33
commit b4ecf8a7ec
2 changed files with 8 additions and 6 deletions

View File

@@ -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)