Skip to content

Commit

Permalink
fix Shadowkin visible in The Dark
Browse files Browse the repository at this point in the history
  • Loading branch information
DEATHB4DEFEAT committed Oct 20, 2023
1 parent 9000a6f commit 8073a56
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ private void OnInvisShutdown(EntityUid uid, ShadowkinDarkSwappedComponent compon
/// Makes the specified entity able to see Shadowkin invisibility.
/// </summary>
/// <param name="uid">Entity to modify</param>
/// <param name="enabled">Whether the entity can see invisibility</param>
/// <param name="set">Whether the entity can see invisibility</param>
/// <param name="invisibility">Should the entity be moved to another visibility layer?</param>
/// <param name="stealth">(Only gets considered if set is true) Adds stealth to the entity</param>
public void SetVisibility(EntityUid uid, bool set, bool invisibility, bool stealth)
Expand Down Expand Up @@ -257,7 +257,7 @@ public void SetVisibility(EntityUid uid, bool set, bool invisibility, bool steal

// Remove the stealth shader from the entity
if (!_entity.TryGetComponent<GhostComponent>(uid, out _))
_stealth.SetVisibility(uid, 1f, _entity.EnsureComponent<StealthComponent>(uid));
_stealth.SetEnabled(uid, false);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Content.Shared.Interaction.Events;
using Content.Shared.Item;
using Content.Shared.SimpleStation14.Species.Shadowkin.Components;
using Content.Shared.Popups;
using Robust.Shared.Timing;
Expand All @@ -21,14 +22,13 @@ public override void Initialize()

private void OnInteractionAttempt(EntityUid uid, ShadowkinDarkSwappedComponent component, InteractionAttemptEvent args)
{
if (args.Target == null || !_entity.TryGetComponent<TransformComponent>(args.Target, out var __) ||
_entity.TryGetComponent<ShadowkinDarkSwappedComponent>(args.Target, out _))
if (args.Target == null ||
!_entity.HasComponent<TransformComponent>(args.Target) ||
_entity.HasComponent<ShadowkinDarkSwappedComponent>(args.Target))
return;

args.Cancel();
if (_gameTiming.InPrediction)
return;

_popup.PopupEntity(Loc.GetString("ethereal-pickup-fail"), args.Target.Value, uid);
if (_gameTiming.InPrediction && _gameTiming.IsFirstTimePredicted)
_popup.PopupEntity(Loc.GetString("ethereal-pickup-fail"), args.Target.Value, uid);
}
}

0 comments on commit 8073a56

Please sign in to comment.