From 8e3243a15648077aad082d5fc299e71d5267defe Mon Sep 17 00:00:00 2001 From: slarticodefast <161409025+slarticodefast@users.noreply.github.com> Date: Thu, 9 Oct 2025 07:03:11 +0200 Subject: [PATCH] Fix changeling blindness (#40517) fix changeling blindness --- .../Traits/Assorted/PermanentBlindnessSystem.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Content.Shared/Traits/Assorted/PermanentBlindnessSystem.cs b/Content.Shared/Traits/Assorted/PermanentBlindnessSystem.cs index a99a12d0fd..e060de7dd9 100644 --- a/Content.Shared/Traits/Assorted/PermanentBlindnessSystem.cs +++ b/Content.Shared/Traits/Assorted/PermanentBlindnessSystem.cs @@ -2,7 +2,6 @@ using Content.Shared.Eye.Blinding.Components; using Content.Shared.Eye.Blinding.Systems; using Content.Shared.IdentityManagement; -using Robust.Shared.Network; namespace Content.Shared.Traits.Assorted; @@ -38,18 +37,23 @@ public sealed class PermanentBlindnessSystem : EntitySystem { _blinding.SetMinDamage((blindness.Owner, blindable), 0); } + + // Heal all eye damage when the component is removed. + // Otherwise you would still be blind, but not *permanently* blind, meaning you have to heal the eye damage with oculine. + // This is needed for changelings that transform from a blind player to a non-blind one. + _blinding.AdjustEyeDamage((blindness.Owner, blindable), -blindable.EyeDamage); } private void OnMapInit(Entity blindness, ref MapInitEvent args) { - if(!TryComp(blindness.Owner, out var blindable)) + if (!TryComp(blindness.Owner, out var blindable)) return; if (blindness.Comp.Blindness != 0) _blinding.SetMinDamage((blindness.Owner, blindable), blindness.Comp.Blindness); else { - var maxMagnitudeInt = (int) BlurryVisionComponent.MaxMagnitude; + var maxMagnitudeInt = (int)BlurryVisionComponent.MaxMagnitude; _blinding.SetMinDamage((blindness.Owner, blindable), maxMagnitudeInt); } } -- 2.51.2