mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
Fix ContainerManagerComponent.ContainsEntity not returning correct results for multiple containers.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.GameObjects.Components;
|
||||
using Robust.Shared.ViewVariables;
|
||||
@@ -8,6 +9,7 @@ namespace Robust.Client.GameObjects.Components.Containers
|
||||
{
|
||||
public sealed partial class ContainerManagerComponent
|
||||
{
|
||||
[DebuggerDisplay("ClientContainer {Owner.Uid}/{ID}")]
|
||||
private sealed class ClientContainer : IContainer
|
||||
{
|
||||
public List<IEntity> Entities { get; } = new List<IEntity>();
|
||||
|
||||
@@ -45,7 +45,10 @@ namespace Robust.Client.GameObjects.Components.Containers
|
||||
{
|
||||
foreach (var container in _containers.Values)
|
||||
{
|
||||
return !container.Deleted && container.Contains(entity);
|
||||
if (!container.Deleted && container.Contains(entity))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -116,7 +116,10 @@ namespace Robust.Server.GameObjects.Components.Container
|
||||
{
|
||||
foreach (var container in EntityContainers.Values)
|
||||
{
|
||||
return !container.Deleted && container.Contains(entity);
|
||||
if (!container.Deleted && container.Contains(entity))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user