Removes duplicate range check in InRangeUnobstructed(#6358)
This commit is contained in:
committed by
GitHub
parent
ee179762fd
commit
6fb492aae7
@@ -292,12 +292,11 @@ namespace Content.Shared.Interaction
|
|||||||
Ignored? predicate = null,
|
Ignored? predicate = null,
|
||||||
bool ignoreInsideBlocker = false)
|
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;
|
var dir = other.Position - origin.Position;
|
||||||
|
|
||||||
if (dir.LengthSquared.Equals(0f)) return true;
|
if (dir.LengthSquared.Equals(0f)) return true;
|
||||||
if (range > 0f && !(dir.LengthSquared <= range * range)) return false;
|
|
||||||
|
|
||||||
predicate ??= _ => false;
|
predicate ??= _ => false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user