Remove ignore-inside-blocker (#6692)

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
Leon Friedrich
2022-02-17 15:40:03 +13:00
committed by GitHub
parent 00c3a181d3
commit 4a00d01ced
60 changed files with 297 additions and 872 deletions

View File

@@ -297,19 +297,6 @@ namespace Content.Client.DragDrop
return false;
}
// now when ending the drag, we will not replay the click because
// by this time we've determined the input was actually a drag attempt
var range = (args.Coordinates.ToMapPos(EntityManager) - EntityManager.GetComponent<TransformComponent>(_dragger).MapPosition.Position).Length + 0.01f;
// tell the server we are dropping if we are over a valid drop target in range.
// We don't use args.EntityUid here because drag interactions generally should
// work even if there's something "on top" of the drop target
if (!_interactionSystem.InRangeUnobstructed(_dragger,
args.Coordinates, range, ignoreInsideBlocker: true))
{
_dragDropHelper.EndDrag();
return false;
}
IList<EntityUid> entities;
if (_stateManager.CurrentState is GameScreen screen)
@@ -333,7 +320,8 @@ namespace Content.Client.DragDrop
// TODO: Cache valid CanDragDrops
if (ValidDragDrop(dropArgs) != true) continue;
if (!dropArgs.InRangeUnobstructed(ignoreInsideBlocker: true))
if (!_interactionSystem.InRangeUnobstructed(dropArgs.User, dropArgs.Target)
|| !_interactionSystem.InRangeUnobstructed(dropArgs.User, dropArgs.Dragged))
{
outOfRange = true;
continue;
@@ -401,7 +389,8 @@ namespace Content.Client.DragDrop
// We'll do a final check given server-side does this before any dragdrop can take place.
if (valid.Value)
{
valid = dropArgs.InRangeUnobstructed(ignoreInsideBlocker: true);
valid = _interactionSystem.InRangeUnobstructed(dropArgs.Target, dropArgs.Dragged)
&& _interactionSystem.InRangeUnobstructed(dropArgs.Target, dropArgs.Target);
}
// highlight depending on whether its in or out of range