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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user