Fix interaction and add comments to CollisionGroup (#8149)
This commit is contained in:
@@ -48,6 +48,9 @@ namespace Content.Shared.Interaction
|
||||
[Dependency] private readonly SharedPhysicsSystem _physicsSystem = default!;
|
||||
[Dependency] protected readonly SharedContainerSystem ContainerSystem = default!;
|
||||
|
||||
private const CollisionGroup InRangeUnobstructedMask
|
||||
= CollisionGroup.Impassable | CollisionGroup.InteractImpassable;
|
||||
|
||||
public const float InteractionRange = 2;
|
||||
public const float InteractionRangeSquared = InteractionRange * InteractionRange;
|
||||
|
||||
@@ -329,7 +332,7 @@ namespace Content.Shared.Interaction
|
||||
public float UnobstructedDistance(
|
||||
MapCoordinates origin,
|
||||
MapCoordinates other,
|
||||
int collisionMask = (int) CollisionGroup.Impassable,
|
||||
int collisionMask = (int) InRangeUnobstructedMask,
|
||||
Ignored? predicate = null)
|
||||
{
|
||||
var dir = other.Position - origin.Position;
|
||||
@@ -368,7 +371,7 @@ namespace Content.Shared.Interaction
|
||||
MapCoordinates origin,
|
||||
MapCoordinates other,
|
||||
float range = InteractionRange,
|
||||
CollisionGroup collisionMask = CollisionGroup.Impassable,
|
||||
CollisionGroup collisionMask = InRangeUnobstructedMask,
|
||||
Ignored? predicate = null)
|
||||
{
|
||||
// Have to be on same map regardless.
|
||||
@@ -425,7 +428,7 @@ namespace Content.Shared.Interaction
|
||||
EntityUid origin,
|
||||
EntityUid other,
|
||||
float range = InteractionRange,
|
||||
CollisionGroup collisionMask = CollisionGroup.Impassable,
|
||||
CollisionGroup collisionMask = InRangeUnobstructedMask,
|
||||
Ignored? predicate = null,
|
||||
bool popup = false)
|
||||
{;
|
||||
@@ -446,7 +449,7 @@ namespace Content.Shared.Interaction
|
||||
MapCoordinates origin,
|
||||
EntityUid target,
|
||||
float range = InteractionRange,
|
||||
CollisionGroup collisionMask = CollisionGroup.Impassable,
|
||||
CollisionGroup collisionMask = InRangeUnobstructedMask,
|
||||
Ignored? predicate = null)
|
||||
{
|
||||
var transform = Transform(target);
|
||||
@@ -518,7 +521,7 @@ namespace Content.Shared.Interaction
|
||||
EntityUid origin,
|
||||
EntityCoordinates other,
|
||||
float range = InteractionRange,
|
||||
CollisionGroup collisionMask = CollisionGroup.Impassable,
|
||||
CollisionGroup collisionMask = InRangeUnobstructedMask,
|
||||
Ignored? predicate = null,
|
||||
bool popup = false)
|
||||
{
|
||||
@@ -553,7 +556,7 @@ namespace Content.Shared.Interaction
|
||||
EntityUid origin,
|
||||
MapCoordinates other,
|
||||
float range = InteractionRange,
|
||||
CollisionGroup collisionMask = CollisionGroup.Impassable,
|
||||
CollisionGroup collisionMask = InRangeUnobstructedMask,
|
||||
Ignored? predicate = null,
|
||||
bool popup = false)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user