Blindness refactor (#15705)

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Leon Friedrich
2023-04-29 17:32:14 +12:00
committed by GitHub
parent e0b809b62d
commit 84299cae63
34 changed files with 460 additions and 456 deletions

View File

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