Clean up if check
This commit is contained in:
@@ -11,11 +11,9 @@ using Content.Shared.GameObjects.EntitySystems;
|
|||||||
using Content.Shared.Input;
|
using Content.Shared.Input;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Server.GameObjects.EntitySystems;
|
|
||||||
using Robust.Server.Interfaces.Player;
|
using Robust.Server.Interfaces.Player;
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.GameObjects.Components;
|
|
||||||
using Robust.Shared.Input;
|
using Robust.Shared.Input;
|
||||||
using Robust.Shared.Input.Binding;
|
using Robust.Shared.Input.Binding;
|
||||||
using Robust.Shared.Interfaces.GameObjects;
|
using Robust.Shared.Interfaces.GameObjects;
|
||||||
@@ -267,15 +265,18 @@ namespace Content.Server.GameObjects.EntitySystems.Click
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// In a container where the attacked entity is not the container's owner and either the attacked entity is null, not contained or in a different container
|
// In a container where the attacked entity is not the container's owner
|
||||||
if (ContainerHelpers.TryGetContainer(player, out var playerContainer) &&
|
if (ContainerHelpers.TryGetContainer(player, out var playerContainer) &&
|
||||||
attacked != playerContainer.Owner &&
|
attacked != playerContainer.Owner)
|
||||||
(attacked == null ||
|
{
|
||||||
|
// Either the attacked entity is null, not contained or in a different container
|
||||||
|
if (attacked == null ||
|
||||||
!ContainerHelpers.TryGetContainer(attacked, out var attackedContainer) ||
|
!ContainerHelpers.TryGetContainer(attacked, out var attackedContainer) ||
|
||||||
attackedContainer != playerContainer))
|
attackedContainer != playerContainer)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Check if client should be able to see that object to click on it in the first place
|
// TODO: Check if client should be able to see that object to click on it in the first place
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user