Clean up if check
This commit is contained in:
@@ -11,11 +11,9 @@ using Content.Shared.GameObjects.EntitySystems;
|
||||
using Content.Shared.Input;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Server.GameObjects.EntitySystems;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.Components;
|
||||
using Robust.Shared.Input;
|
||||
using Robust.Shared.Input.Binding;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
@@ -267,14 +265,17 @@ namespace Content.Server.GameObjects.EntitySystems.Click
|
||||
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) &&
|
||||
attacked != playerContainer.Owner &&
|
||||
(attacked == null ||
|
||||
!ContainerHelpers.TryGetContainer(attacked, out var attackedContainer) ||
|
||||
attackedContainer != playerContainer))
|
||||
attacked != playerContainer.Owner)
|
||||
{
|
||||
return;
|
||||
// Either the attacked entity is null, not contained or in a different container
|
||||
if (attacked == null ||
|
||||
!ContainerHelpers.TryGetContainer(attacked, out var attackedContainer) ||
|
||||
attackedContainer != playerContainer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 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