Fix ghosts being able to empty backpacks by click dragging them onto tables (#1438)

This commit is contained in:
DrSmugleaf
2020-07-23 01:41:22 +02:00
committed by GitHub
parent b88afec350
commit 327b3b610f

View File

@@ -6,6 +6,7 @@ using Content.Server.Interfaces.GameObjects;
using Content.Server.Interfaces.GameObjects.Components.Interaction; using Content.Server.Interfaces.GameObjects.Components.Interaction;
using Content.Server.Utility; using Content.Server.Utility;
using Content.Shared.GameObjects.Components.Storage; using Content.Shared.GameObjects.Components.Storage;
using Content.Shared.GameObjects.EntitySystems;
using Content.Shared.Interfaces; using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components; using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
@@ -490,6 +491,11 @@ namespace Content.Server.GameObjects.Components.Items.Storage
bool IDragDrop.DragDrop(DragDropEventArgs eventArgs) bool IDragDrop.DragDrop(DragDropEventArgs eventArgs)
{ {
if (!ActionBlockerSystem.CanInteract(eventArgs.User))
{
return false;
}
if (!eventArgs.Target.TryGetComponent<PlaceableSurfaceComponent>(out var placeableSurface) || if (!eventArgs.Target.TryGetComponent<PlaceableSurfaceComponent>(out var placeableSurface) ||
!placeableSurface.IsPlaceable) !placeableSurface.IsPlaceable)
{ {