diff --git a/Content.Client/SS220/Overlays/IgnoreLightVisionOverlay.cs b/Content.Client/SS220/Overlays/IgnoreLightVisionOverlay.cs index d9295ef52e74..c2dc18fbbde5 100644 --- a/Content.Client/SS220/Overlays/IgnoreLightVisionOverlay.cs +++ b/Content.Client/SS220/Overlays/IgnoreLightVisionOverlay.cs @@ -73,9 +73,9 @@ protected override void Draw(in OverlayDrawArgs args) if (CantBeRendered(uid, out var sprite, out var xform)) continue; - if (CantBeSeenByThermals((uid, stateComp))) + if (CantBeSeen((uid, stateComp))) continue; - if (IsStealthToThermals(uid, isCloseToOwner)) + if (IsStealthEnough(uid, isCloseToOwner)) continue; if (_container.IsEntityOrParentInContainer(uid)) if (CantBeVisibleInContainer(uid, isCloseToOwner)) @@ -88,20 +88,20 @@ protected override void Draw(in OverlayDrawArgs args) protected abstract void Render(Entity ent, MapId? map, DrawingHandleWorld handle, Angle eyeRot); /// - /// function wich defines what entities can be seen, f.e. pai or human, bread dog or reaper + /// function which defines what entities can be seen, f.e. pai or human, bread dog or reaper /// Also contains list of components which defines it /// /// True if entities could be seen by thermals. Without any other obstacles - private bool CantBeSeenByThermals(Entity target) + private bool CantBeSeen(Entity target) { var states = target.Comp.AllowedStates; + if (target.Comp.CurrentState == MobState.Dead) + return true; + if (states.Contains(MobState.Dead) && - states.Contains(MobState.Alive) && - target.Comp.CurrentState == MobState.Dead) - return true; - else - return false; + states.Contains(MobState.Alive)) + return false; return true; } @@ -119,11 +119,11 @@ private bool CantBeRendered(EntityUid target, [NotNullWhen(false)] out SpriteCom return false; } /// - /// function wich defines what entities visible or not. + /// function which defines what entities visible or not. /// Also contains const values of invis perception /// /// True if entities could be seen by thermals. Without any other obstacles - private bool IsStealthToThermals(EntityUid target, bool isCloseToOwner) + private bool IsStealthEnough(EntityUid target, bool isCloseToOwner) { if (!Entity.TryGetComponent(target, out var component)) return false; @@ -134,8 +134,7 @@ private bool IsStealthToThermals(EntityUid target, bool isCloseToOwner) return false; } - /// function wich defines what entities visible or not. - /// Also contains const values of invis perception + /// function for verifying if we can see smth in container /// True if entities could be seen by thermals. Without any other obstacles private bool CantBeVisibleInContainer(EntityUid target, bool isCloseToOwner) { @@ -159,7 +158,7 @@ private bool CantBeVisibleInContainer(EntityUid target, bool isCloseToOwner) } /// Checks if entity has a components from list /// True if entity has any of the listed components - /// Throw excep if List contains false comp name + /// Throw exception if List contains false comp name private bool HasComponentFromList(EntityUid target, List blacklistComponentNames) { foreach (var compName in blacklistComponentNames)