Skip to content

Commit

Permalink
Fix Thermal Again (#1508)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alwayswannahunt authored Aug 4, 2024
1 parent 4145e11 commit ec57f0a
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions Content.Client/SS220/Overlays/IgnoreLightVisionOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -88,20 +88,20 @@ protected override void Draw(in OverlayDrawArgs args)
protected abstract void Render(Entity<SpriteComponent, TransformComponent> ent,
MapId? map, DrawingHandleWorld handle, Angle eyeRot);
/// <summary>
/// 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
/// </summary>
/// <returns> True if entities could be seen by thermals. Without any other obstacles </returns>
private bool CantBeSeenByThermals(Entity<MobStateComponent> target)
private bool CantBeSeen(Entity<MobStateComponent> 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;
}
Expand All @@ -119,11 +119,11 @@ private bool CantBeRendered(EntityUid target, [NotNullWhen(false)] out SpriteCom
return false;
}
/// <summary>
/// function wich defines what entities visible or not.
/// function which defines what entities visible or not.
/// Also contains const values of invis perception
/// </summary>
/// <returns>True if entities could be seen by thermals. Without any other obstacles </returns>
private bool IsStealthToThermals(EntityUid target, bool isCloseToOwner)
private bool IsStealthEnough(EntityUid target, bool isCloseToOwner)
{
if (!Entity.TryGetComponent<StealthComponent>(target, out var component))
return false;
Expand All @@ -134,8 +134,7 @@ private bool IsStealthToThermals(EntityUid target, bool isCloseToOwner)

return false;
}
/// <summary> function wich defines what entities visible or not.
/// Also contains const values of invis perception </summary>
/// <summary> function for verifying if we can see smth in container </summary>
/// <returns>True if entities could be seen by thermals. Without any other obstacles </returns>
private bool CantBeVisibleInContainer(EntityUid target, bool isCloseToOwner)
{
Expand All @@ -159,7 +158,7 @@ private bool CantBeVisibleInContainer(EntityUid target, bool isCloseToOwner)
}
/// <summary> Checks if entity has a components from list </summary>
/// <returns> True if entity has any of the listed components </returns>
/// <exception cref="Exception"> Throw excep if List contains false comp name</exception>
/// <exception cref="Exception"> Throw exception if List contains false comp name</exception>
private bool HasComponentFromList(EntityUid target, List<string> blacklistComponentNames)
{
foreach (var compName in blacklistComponentNames)
Expand Down

0 comments on commit ec57f0a

Please sign in to comment.