Cleanup (#2111)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -494,13 +494,13 @@ namespace Content.Server.GameObjects.EntitySystems.AI.Pathfinding.Pathfinders
|
||||
}
|
||||
|
||||
if ((closedNeighborOne == null || !PathfindingHelpers.Traversable(_pathfindingArgs.CollisionMask, _pathfindingArgs.Access, closedNeighborOne)) &&
|
||||
(openNeighborOne != null && PathfindingHelpers.Traversable(_pathfindingArgs.CollisionMask, _pathfindingArgs.Access, openNeighborOne)))
|
||||
openNeighborOne != null && PathfindingHelpers.Traversable(_pathfindingArgs.CollisionMask, _pathfindingArgs.Access, openNeighborOne))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((closedNeighborTwo == null || !PathfindingHelpers.Traversable(_pathfindingArgs.CollisionMask, _pathfindingArgs.Access, closedNeighborTwo)) &&
|
||||
(openNeighborTwo != null && PathfindingHelpers.Traversable(_pathfindingArgs.CollisionMask, _pathfindingArgs.Access, openNeighborTwo)))
|
||||
openNeighborTwo != null && PathfindingHelpers.Traversable(_pathfindingArgs.CollisionMask, _pathfindingArgs.Access, openNeighborTwo))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -406,7 +406,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click
|
||||
// InteractUsing/AfterInteract: We will either use the item on the nearby object
|
||||
if (item != null)
|
||||
{
|
||||
Interaction(player, item, attacked, coordinates);
|
||||
_ = Interaction(player, item, attacked, coordinates);
|
||||
}
|
||||
// InteractHand/Activate: Since our hand is empty we will use InteractHand/Activate
|
||||
else
|
||||
|
||||
@@ -28,7 +28,6 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
[UsedImplicitly]
|
||||
internal sealed class HandsSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
|
||||
private const float ThrowForce = 1.5f; // Throwing force of mobs in Newtons
|
||||
@@ -126,10 +125,10 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
var entCoords = ent.Transform.Coordinates.Position;
|
||||
var entToDesiredDropCoords = coords.Position - entCoords;
|
||||
var targetLength = Math.Min(entToDesiredDropCoords.Length, SharedInteractionSystem.InteractionRange - 0.001f); // InteractionRange is reduced due to InRange not dealing with floating point error
|
||||
var newCoords = coords.WithPosition((entToDesiredDropCoords.Normalized * targetLength) + entCoords).ToMap(_entityManager);
|
||||
var newCoords = coords.WithPosition(entToDesiredDropCoords.Normalized * targetLength + entCoords).ToMap(_entityManager);
|
||||
var rayLength = Get<SharedInteractionSystem>().UnobstructedDistance(ent.Transform.MapPosition, newCoords, ignoredEnt: ent);
|
||||
|
||||
handsComp.Drop(handsComp.ActiveHand, coords.WithPosition(entCoords + (entToDesiredDropCoords.Normalized * rayLength)));
|
||||
handsComp.Drop(handsComp.ActiveHand, coords.WithPosition(entCoords + entToDesiredDropCoords.Normalized * rayLength));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user