Removes duplicate range check in InRangeUnobstructed(#6358)

This commit is contained in:
WlarusFromDaSpace 2022-01-30 00:49:43 +00:00 committed by GitHub
parent ee179762fd
commit 6fb492aae7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;