Revert "Fix prescription glasses working from pockets (#286)"

This reverts commit 168699d23a.
This commit is contained in:
null
2024-05-18 13:37:43 +02:00
parent fc8ddf7df1
commit 51c06a3613
@@ -32,21 +32,15 @@ public sealed class NearsightedSystem : EntitySystem
private void OnEquip(GotEquippedEvent args)
{
// Note: it would be cleaner to check if the glasses are being equipped
// to the eyes rather than the pockets using `args.SlotFlags.HasFlag(SlotFlags.EYES)`,
// but this field is not present on GotUnequippedEvent. This method is
// used for both equip and unequip to make it consistent between checks.
if (TryComp<NearsightedComponent>(args.Equipee, out var nearsighted) &&
EnsureComp<TagComponent>(args.Equipment).Tags.Contains("GlassesNearsight") &&
args.Slot == "eyes")
EnsureComp<TagComponent>(args.Equipment).Tags.Contains("GlassesNearsight"))
UpdateShader(nearsighted, true);
}
private void OnUnEquip(GotUnequippedEvent args)
{
if (TryComp<NearsightedComponent>(args.Equipee, out var nearsighted) &&
EnsureComp<TagComponent>(args.Equipment).Tags.Contains("GlassesNearsight") &&
args.Slot == "eyes")
EnsureComp<TagComponent>(args.Equipment).Tags.Contains("GlassesNearsight"))
UpdateShader(nearsighted, false);
}