Updated ContainerHelpers to use new extensions (#2530)
Co-authored-by: David Tan <>
This commit is contained in:
@@ -86,8 +86,8 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
return;
|
||||
}
|
||||
|
||||
var contained = ContainerHelpers.TryGetContainer(buckle.Owner, out var ownContainer);
|
||||
var strapContained = ContainerHelpers.TryGetContainer(strap.Owner, out var strapContainer);
|
||||
var contained = buckle.Owner.TryGetContainer(out var ownContainer);
|
||||
var strapContained = strap.Owner.TryGetContainer(out var strapContainer);
|
||||
|
||||
if (contained != strapContained || ownContainer != strapContainer)
|
||||
{
|
||||
|
||||
@@ -329,19 +329,19 @@ namespace Content.Server.GameObjects.EntitySystems.Click
|
||||
}
|
||||
|
||||
// If in a container
|
||||
if (ContainerHelpers.IsInContainer(player))
|
||||
if (player.IsInContainer())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// In a container where the attacked entity is not the container's owner
|
||||
if (ContainerHelpers.TryGetContainer(player, out var playerContainer) &&
|
||||
if (player.TryGetContainer(out var playerContainer) &&
|
||||
attacked != playerContainer.Owner)
|
||||
{
|
||||
// Either the attacked entity is null, not contained or in a different container
|
||||
if (attacked == null ||
|
||||
!ContainerHelpers.TryGetContainer(attacked, out var attackedContainer) ||
|
||||
!attacked.TryGetContainer(out var attackedContainer) ||
|
||||
attackedContainer != playerContainer)
|
||||
{
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user