Fix disposals anchored test and fix disconnect method (#1545)

This commit is contained in:
DrSmugleaf
2020-07-31 00:12:45 +02:00
committed by GitHub
parent bfe2217112
commit 7c1acf2fe1
2 changed files with 5 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ using Content.Server.GameObjects.Components;
using Content.Server.GameObjects.Components.Disposal;
using Content.Server.GameObjects.Components.Power.ApcNetComponents;
using NUnit.Framework;
using Robust.Shared.GameObjects.Components;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Map;
using Robust.Shared.IoC;
@@ -85,10 +86,13 @@ namespace Content.IntegrationTests.Tests.Disposal
Assert.True(disposalTrunk.TryGetComponent(out entry));
// Can't insert, unanchored and unpowered
var disposalUnitAnchorable = disposalUnit.GetComponent<AnchorableComponent>();
disposalUnitAnchorable.TryUnAnchor(human, null, true);
UnitInsertContains(unit, false, human, wrench, disposalUnit, disposalTrunk);
Assert.False(unit.Anchored);
// Anchor the disposal unit
disposalUnitAnchorable.TryAnchor(human, null, true);
Assert.True(disposalUnit.TryGetComponent(out AnchorableComponent anchorableUnit));
Assert.True(anchorableUnit.TryAnchor(human, wrench));
Assert.True(unit.Anchored);

View File

@@ -156,7 +156,7 @@ namespace Content.Server.GameObjects.Components.Disposal
_connected = false;
foreach (var entity in Contents.ContainedEntities)
foreach (var entity in Contents.ContainedEntities.ToArray())
{
if (!entity.TryGetComponent(out DisposalHolderComponent holder))
{