From 6fb492aae7bd5f158481e331d95d742aa8fa1c8a Mon Sep 17 00:00:00 2001 From: WlarusFromDaSpace <44726328+WlarusFromDaSpace@users.noreply.github.com> Date: Sun, 30 Jan 2022 00:49:43 +0000 Subject: [PATCH] Removes duplicate range check in `InRangeUnobstructed`(#6358) --- Content.Shared/Interaction/SharedInteractionSystem.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Content.Shared/Interaction/SharedInteractionSystem.cs b/Content.Shared/Interaction/SharedInteractionSystem.cs index 2440faacbb..88342f9a2d 100644 --- a/Content.Shared/Interaction/SharedInteractionSystem.cs +++ b/Content.Shared/Interaction/SharedInteractionSystem.cs @@ -292,12 +292,11 @@ namespace Content.Shared.Interaction Ignored? predicate = null, bool ignoreInsideBlocker = false) { - if (!origin.InRange(other, range)) return false; + if (range > 0f && !origin.InRange(other, range)) return false; var dir = other.Position - origin.Position; if (dir.LengthSquared.Equals(0f)) return true; - if (range > 0f && !(dir.LengthSquared <= range * range)) return false; predicate ??= _ => false;