Use nearest edge for interaction range (#11660)

Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2022-10-07 00:37:21 +11:00
committed by GitHub
parent 3b763192b0
commit c555203401
3 changed files with 88 additions and 18 deletions

View File

@@ -22,6 +22,8 @@ namespace Content.IntegrationTests.Tests.Interaction
private const float InteractionRangeDivided15Times3 = InteractionRangeDivided15 * 3;
private const float HumanRadius = 0.35f;
[Test]
public async Task EntityEntityTest()
{
@@ -74,7 +76,7 @@ namespace Content.IntegrationTests.Tests.Interaction
Assert.True(interactionSys.InRangeUnobstructed(mapCoordinates, origin));
// Move them out of range
sEntities.GetComponent<TransformComponent>(origin).LocalPosition += _interactionRangeDivided15X;
sEntities.GetComponent<TransformComponent>(origin).LocalPosition += new Vector2(InteractionRangeDivided15 + HumanRadius * 2f, 0f);
// Entity <-> Entity
Assert.False(interactionSys.InRangeUnobstructed(origin, other));