diff --git a/Content.Server/Flash/FlashSystem.cs b/Content.Server/Flash/FlashSystem.cs index 3f585b4403..80f669df9e 100644 --- a/Content.Server/Flash/FlashSystem.cs +++ b/Content.Server/Flash/FlashSystem.cs @@ -1,4 +1,5 @@ using Content.Server.Flash.Components; +using Content.Server.Light.EntitySystems; using Content.Server.Stunnable; using Content.Server.Weapon.Melee; using Content.Shared.Examine; @@ -31,6 +32,7 @@ namespace Content.Server.Flash { base.Initialize(); SubscribeLocalEvent(OnFlashMeleeHit); + SubscribeLocalEvent(OnFlashUseInHand, before: new []{ typeof(HandheldLightSystem) }); SubscribeLocalEvent(OnFlashExamined); SubscribeLocalEvent(OnInventoryFlashAttempt); @@ -67,9 +69,7 @@ namespace Content.Server.Flash private void OnFlashMeleeHit(EntityUid uid, FlashComponent comp, MeleeHitEvent args) { if (!UseFlash(comp, args.User)) - { return; - } args.Handled = true; foreach (var e in args.HitEntities) @@ -77,6 +77,15 @@ namespace Content.Server.Flash Flash(e, args.User, uid, comp.FlashDuration, comp.SlowTo); } } + + private void OnFlashUseInHand(EntityUid uid, FlashComponent comp, UseInHandEvent args) + { + if (args.Handled || !UseFlash(comp, args.User)) + return; + + args.Handled = true; + FlashArea(uid, args.User, comp.Range, comp.AoeFlashDuration, comp.SlowTo, true); + } private bool UseFlash(FlashComponent comp, EntityUid user) {