Add flash immunity to welding masks (#7561)

This commit is contained in:
Julian Giebel
2022-04-16 00:51:56 +02:00
committed by GitHub
parent 996bc8d5fb
commit 456ccfc858
2 changed files with 6 additions and 2 deletions

View File

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