Blindness refactor (#15705)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using Content.Shared.Eye.Blinding;
|
||||
using Content.Server.UserInterface;
|
||||
using Content.Server.Popups;
|
||||
using Content.Shared.Eye.Blinding.Components;
|
||||
using Content.Shared.Eye.Blinding.Systems;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Server.GameObjects;
|
||||
|
||||
@@ -23,14 +25,14 @@ public sealed class ActivatableUIRequiresVisionSystem : EntitySystem
|
||||
if (args.Cancelled)
|
||||
return;
|
||||
|
||||
if (TryComp<BlindableComponent>(args.User, out var blindable) && blindable.Sources > 0)
|
||||
if (TryComp<BlindableComponent>(args.User, out var blindable) && blindable.IsBlind)
|
||||
{
|
||||
_popupSystem.PopupCursor(Loc.GetString("blindness-fail-attempt"), args.User, Shared.Popups.PopupType.MediumCaution);
|
||||
args.Cancel();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnBlindnessChanged(EntityUid uid, BlindableComponent component, BlindnessChangedEvent args)
|
||||
private void OnBlindnessChanged(EntityUid uid, BlindableComponent component, ref BlindnessChangedEvent args)
|
||||
{
|
||||
if (!args.Blind)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user