Got rid of some IEntities

This commit is contained in:
Wrexbe
2021-12-03 11:15:41 -08:00
parent f5b8bb3731
commit e2d7ea6f62
7 changed files with 81 additions and 83 deletions

View File

@@ -43,7 +43,7 @@ namespace Content.Shared.Interaction
public const float InteractionRange = 2;
public const float InteractionRangeSquared = InteractionRange * InteractionRange;
public delegate bool Ignored(IEntity entity);
public delegate bool Ignored(EntityUid entity);
/// <summary>
/// Traces a ray from coords to otherCoords and returns the length
@@ -94,7 +94,7 @@ namespace Content.Shared.Interaction
{
var predicate = ignoredEnt == null
? null
: (Ignored) (e => e == ignoredEnt);
: (Ignored) (e => e == ignoredEnt?.Uid);
return UnobstructedDistance(origin, other, collisionMask, predicate);
}
@@ -212,7 +212,7 @@ namespace Content.Shared.Interaction
bool ignoreInsideBlocker = false,
bool popup = false)
{
predicate ??= e => e == origin || e == other;
predicate ??= e => e == origin.Uid || e == other.Uid;
return InRangeUnobstructed(origin, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(other).MapPosition, range, collisionMask, predicate, ignoreInsideBlocker, popup);
}
@@ -346,7 +346,7 @@ namespace Content.Shared.Interaction
bool popup = false)
{
var originPosition = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(origin).MapPosition;
predicate ??= e => e == origin;
predicate ??= e => e == origin.Uid;
var inRange = InRangeUnobstructed(originPosition, other, range, collisionMask, predicate, ignoreInsideBlocker);