ECS and cleanup body system, merge body templates and presets into body prototypes (#11991)
Co-authored-by: Jezithyr <Jezithyr@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
using System.Threading.Tasks;
|
||||
using Content.Server.Body.Components;
|
||||
using Content.Server.Body.Systems;
|
||||
using Content.Shared.Body.Components;
|
||||
using Content.Shared.Body.Part;
|
||||
using Content.Shared.Rotation;
|
||||
@@ -12,7 +12,7 @@ using Robust.Shared.Maths;
|
||||
namespace Content.IntegrationTests.Tests.Body
|
||||
{
|
||||
[TestFixture]
|
||||
[TestOf(typeof(SharedBodyComponent))]
|
||||
[TestOf(typeof(BodyPartComponent))]
|
||||
[TestOf(typeof(BodyComponent))]
|
||||
public sealed class LegTest
|
||||
{
|
||||
@@ -23,16 +23,15 @@ namespace Content.IntegrationTests.Tests.Body
|
||||
components:
|
||||
- type: Appearance
|
||||
- type: Body
|
||||
template: HumanoidTemplate
|
||||
preset: HumanPreset
|
||||
centerSlot: torso
|
||||
prototype: Human
|
||||
- type: StandingState
|
||||
";
|
||||
|
||||
[Test]
|
||||
public async Task RemoveLegsFallTest()
|
||||
{
|
||||
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings{NoClient = true, ExtraPrototypes = Prototypes});
|
||||
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings
|
||||
{NoClient = true, ExtraPrototypes = Prototypes});
|
||||
var server = pairTracker.Pair.Server;
|
||||
|
||||
AppearanceComponent appearance = null;
|
||||
@@ -44,18 +43,20 @@ namespace Content.IntegrationTests.Tests.Body
|
||||
var mapId = mapManager.CreateMap();
|
||||
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
var human = entityManager.SpawnEntity("HumanBodyAndAppearanceDummy", new MapCoordinates(Vector2.Zero, mapId));
|
||||
var human = entityManager.SpawnEntity("HumanBodyAndAppearanceDummy",
|
||||
new MapCoordinates(Vector2.Zero, mapId));
|
||||
|
||||
Assert.That(entityManager.TryGetComponent(human, out SharedBodyComponent body));
|
||||
Assert.That(entityManager.TryGetComponent(human, out BodyComponent body));
|
||||
Assert.That(entityManager.TryGetComponent(human, out appearance));
|
||||
|
||||
Assert.That(!appearance.TryGetData(RotationVisuals.RotationState, out RotationState _));
|
||||
|
||||
var legs = body.GetPartsOfType(BodyPartType.Leg);
|
||||
var bodySystem = entityManager.System<BodySystem>();
|
||||
var legs = bodySystem.GetBodyChildrenOfType(body.Owner, BodyPartType.Leg, body);
|
||||
|
||||
foreach (var leg in legs)
|
||||
{
|
||||
body.RemovePart(leg);
|
||||
bodySystem.DropPart(leg.Id, leg.Component);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -22,9 +22,7 @@ namespace Content.IntegrationTests.Tests.Body
|
||||
components:
|
||||
- type: SolutionContainerManager
|
||||
- type: Body
|
||||
template: HumanoidTemplate
|
||||
preset: HumanPreset
|
||||
centerSlot: torso
|
||||
prototype: Human
|
||||
- type: MobState
|
||||
thresholds:
|
||||
0: Alive
|
||||
@@ -49,7 +47,8 @@ namespace Content.IntegrationTests.Tests.Body
|
||||
public async Task AirConsistencyTest()
|
||||
{
|
||||
// --- Setup
|
||||
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings{NoClient = true, ExtraPrototypes = Prototypes});
|
||||
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings
|
||||
{NoClient = true, ExtraPrototypes = Prototypes});
|
||||
var server = pairTracker.Pair.Server;
|
||||
|
||||
await server.WaitIdleAsync();
|
||||
@@ -62,7 +61,7 @@ namespace Content.IntegrationTests.Tests.Body
|
||||
|
||||
MapId mapId;
|
||||
EntityUid? grid = null;
|
||||
SharedBodyComponent body = default;
|
||||
BodyComponent body = default;
|
||||
EntityUid human = default;
|
||||
GridAtmosphereComponent relevantAtmos = default;
|
||||
float startingMoles = 0.0f;
|
||||
@@ -127,7 +126,8 @@ namespace Content.IntegrationTests.Tests.Body
|
||||
[Test]
|
||||
public async Task NoSuffocationTest()
|
||||
{
|
||||
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings{NoClient = true, ExtraPrototypes = Prototypes});
|
||||
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings
|
||||
{NoClient = true, ExtraPrototypes = Prototypes});
|
||||
var server = pairTracker.Pair.Server;
|
||||
|
||||
var mapLoader = server.ResolveDependency<IMapLoader>();
|
||||
@@ -155,7 +155,7 @@ namespace Content.IntegrationTests.Tests.Body
|
||||
var coordinates = new EntityCoordinates(grid.Value, center);
|
||||
human = entityManager.SpawnEntity("HumanBodyDummy", coordinates);
|
||||
|
||||
Assert.True(entityManager.HasComponent<SharedBodyComponent>(human));
|
||||
Assert.True(entityManager.HasComponent<BodyComponent>(human));
|
||||
Assert.True(entityManager.TryGetComponent(human, out respirator));
|
||||
Assert.False(respirator.SuffocationCycles > respirator.SuffocationCycleThreshold);
|
||||
});
|
||||
@@ -167,7 +167,8 @@ namespace Content.IntegrationTests.Tests.Body
|
||||
await server.WaitRunTicks(increment);
|
||||
await server.WaitAssertion(() =>
|
||||
{
|
||||
Assert.False(respirator.SuffocationCycles > respirator.SuffocationCycleThreshold, $"Entity {entityManager.GetComponent<MetaDataComponent>(human).EntityName} is suffocating on tick {tick}");
|
||||
Assert.False(respirator.SuffocationCycles > respirator.SuffocationCycleThreshold,
|
||||
$"Entity {entityManager.GetComponent<MetaDataComponent>(human).EntityName} is suffocating on tick {tick}");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
148
Content.IntegrationTests/Tests/Body/SaveLoadReparentTest.cs
Normal file
148
Content.IntegrationTests/Tests/Body/SaveLoadReparentTest.cs
Normal file
@@ -0,0 +1,148 @@
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Content.Shared.Body.Components;
|
||||
using Content.Shared.Body.Systems;
|
||||
using NUnit.Framework;
|
||||
using Robust.Server.Maps;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Map;
|
||||
|
||||
namespace Content.IntegrationTests.Tests.Body;
|
||||
|
||||
[TestFixture]
|
||||
public sealed class SaveLoadReparentTest
|
||||
{
|
||||
private const string Prototypes = @"
|
||||
- type: entity
|
||||
name: HumanBodyDummy
|
||||
id: HumanBodyDummy
|
||||
components:
|
||||
- type: Body
|
||||
prototype: Human
|
||||
";
|
||||
|
||||
[Test]
|
||||
public async Task Test()
|
||||
{
|
||||
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings
|
||||
{
|
||||
NoClient = true,
|
||||
ExtraPrototypes = Prototypes
|
||||
});
|
||||
var server = pairTracker.Pair.Server;
|
||||
|
||||
var entities = server.ResolveDependency<IEntityManager>();
|
||||
var maps = server.ResolveDependency<IMapManager>();
|
||||
var mapLoader = server.ResolveDependency<IMapLoader>();
|
||||
var bodySystem = entities.System<SharedBodySystem>();
|
||||
|
||||
await server.WaitAssertion(() =>
|
||||
{
|
||||
var mapId = maps.CreateMap();
|
||||
maps.CreateGrid(mapId);
|
||||
var human = entities.SpawnEntity("HumanBodyDummy", new MapCoordinates(0, 0, mapId));
|
||||
|
||||
Assert.That(entities.HasComponent<BodyComponent>(human), Is.True);
|
||||
|
||||
var parts = bodySystem.GetBodyChildren(human).ToArray();
|
||||
var organs = bodySystem.GetBodyOrgans(human).ToArray();
|
||||
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(parts, Is.Not.Empty);
|
||||
Assert.That(organs, Is.Not.Empty);
|
||||
});
|
||||
|
||||
foreach (var (id, component) in parts)
|
||||
{
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(component.Body, Is.EqualTo(human));
|
||||
Assert.That(component.ParentSlot, Is.Not.Null);
|
||||
Assert.That(component.ParentSlot.Parent, Is.Not.EqualTo(default(EntityUid)));
|
||||
Assert.That(component.ParentSlot.Child, Is.EqualTo(id));
|
||||
});
|
||||
|
||||
foreach (var (slotId, slot) in component.Children)
|
||||
{
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(slot.Id, Is.EqualTo(slotId));
|
||||
Assert.That(slot.Parent, Is.Not.EqualTo(default(EntityUid)));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var (id, component) in organs)
|
||||
{
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(component.Body, Is.EqualTo(human));
|
||||
Assert.That(component.ParentSlot, Is.Not.Null);
|
||||
Assert.That(component.ParentSlot.Parent, Is.Not.EqualTo(default(EntityUid)));
|
||||
Assert.That(component.ParentSlot.Child, Is.EqualTo(id));
|
||||
});
|
||||
}
|
||||
|
||||
Assert.That(entities
|
||||
.EntityQuery<BodyComponent>()
|
||||
.Where(e => entities.GetComponent<MetaDataComponent>(e.Owner).EntityPrototype!.Name ==
|
||||
"HumanBodyDummy"), Is.Not.Empty);
|
||||
|
||||
const string mapPath = $"/{nameof(SaveLoadReparentTest)}{nameof(Test)}map.yml";
|
||||
|
||||
mapLoader.SaveMap(mapId, mapPath);
|
||||
maps.DeleteMap(mapId);
|
||||
|
||||
mapId = maps.CreateMap();
|
||||
mapLoader.LoadMap(mapId, mapPath);
|
||||
|
||||
var query = entities
|
||||
.EntityQuery<BodyComponent>()
|
||||
.Where(e => entities.GetComponent<MetaDataComponent>(e.Owner).EntityPrototype!.Name == "HumanBodyDummy")
|
||||
.ToArray();
|
||||
|
||||
Assert.That(query, Is.Not.Empty);
|
||||
foreach (var body in query)
|
||||
{
|
||||
human = body.Owner;
|
||||
parts = bodySystem.GetBodyChildren(human).ToArray();
|
||||
organs = bodySystem.GetBodyOrgans(human).ToArray();
|
||||
|
||||
Assert.That(parts, Is.Not.Empty);
|
||||
Assert.That(organs, Is.Not.Empty);
|
||||
|
||||
foreach (var (id, component) in parts)
|
||||
{
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(component.Body, Is.EqualTo(human));
|
||||
Assert.That(component.ParentSlot, Is.Not.Null);
|
||||
Assert.That(component.ParentSlot.Parent, Is.Not.EqualTo(default(EntityUid)));
|
||||
Assert.That(component.ParentSlot.Child, Is.EqualTo(id));
|
||||
});
|
||||
|
||||
foreach (var (slotId, slot) in component.Children)
|
||||
{
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(slot.Id, Is.EqualTo(slotId));
|
||||
Assert.That(slot.Parent, Is.Not.EqualTo(default(EntityUid)));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var (id, component) in organs)
|
||||
{
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(component.Body, Is.EqualTo(human));
|
||||
Assert.That(component.ParentSlot, Is.Not.Null);
|
||||
Assert.That(component.ParentSlot.Parent, Is.Not.EqualTo(default(EntityUid)));
|
||||
Assert.That(component.ParentSlot.Child, Is.EqualTo(id));
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Threading.Tasks;
|
||||
using Content.Server.Body.Systems;
|
||||
using Content.Server.Buckle.Components;
|
||||
using Content.Server.Hands.Components;
|
||||
using Content.Shared.ActionBlocker;
|
||||
@@ -9,8 +10,6 @@ using Content.Shared.Hands.EntitySystems;
|
||||
using Content.Shared.Standing;
|
||||
using NUnit.Framework;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Map;
|
||||
|
||||
namespace Content.IntegrationTests.Tests.Buckle
|
||||
{
|
||||
@@ -31,9 +30,7 @@ namespace Content.IntegrationTests.Tests.Buckle
|
||||
- type: Buckle
|
||||
- type: Hands
|
||||
- type: Body
|
||||
template: HumanoidTemplate
|
||||
preset: HumanPreset
|
||||
centerSlot: torso
|
||||
prototype: Human
|
||||
- type: StandingState
|
||||
|
||||
- type: entity
|
||||
@@ -48,10 +45,12 @@ namespace Content.IntegrationTests.Tests.Buckle
|
||||
components:
|
||||
- type: Item
|
||||
";
|
||||
|
||||
[Test]
|
||||
public async Task BuckleUnbuckleCooldownRangeTest()
|
||||
{
|
||||
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings{ExtraPrototypes = Prototypes});
|
||||
await using var pairTracker =
|
||||
await PoolManager.GetServerClient(new PoolSettings {ExtraPrototypes = Prototypes});
|
||||
var server = pairTracker.Pair.Server;
|
||||
|
||||
var testMap = await PoolManager.CreateTestMap(pairTracker);
|
||||
@@ -96,7 +95,10 @@ namespace Content.IntegrationTests.Tests.Buckle
|
||||
Assert.False(actionBlocker.CanMove(human));
|
||||
Assert.False(actionBlocker.CanChangeDirection(human));
|
||||
Assert.False(standingState.Down(human));
|
||||
Assert.That((entityManager.GetComponent<TransformComponent>(human).WorldPosition - entityManager.GetComponent<TransformComponent>(chair).WorldPosition).Length, Is.LessThanOrEqualTo(buckle.BuckleOffset.Length));
|
||||
Assert.That(
|
||||
(entityManager.GetComponent<TransformComponent>(human).WorldPosition -
|
||||
entityManager.GetComponent<TransformComponent>(chair).WorldPosition).Length,
|
||||
Is.LessThanOrEqualTo(buckle.BuckleOffset.Length));
|
||||
|
||||
// Side effects of buckling for the strap
|
||||
Assert.That(strap.BuckledEntities, Does.Contain(human));
|
||||
@@ -166,7 +168,8 @@ namespace Content.IntegrationTests.Tests.Buckle
|
||||
Assert.False(buckle.ToggleBuckle(human, chair));
|
||||
|
||||
// Move near the chair
|
||||
entityManager.GetComponent<TransformComponent>(human).WorldPosition = entityManager.GetComponent<TransformComponent>(chair).WorldPosition + (0.5f, 0);
|
||||
entityManager.GetComponent<TransformComponent>(human).WorldPosition =
|
||||
entityManager.GetComponent<TransformComponent>(chair).WorldPosition + (0.5f, 0);
|
||||
|
||||
// In range
|
||||
Assert.True(buckle.TryBuckle(human, chair));
|
||||
@@ -206,7 +209,8 @@ namespace Content.IntegrationTests.Tests.Buckle
|
||||
[Test]
|
||||
public async Task BuckledDyingDropItemsTest()
|
||||
{
|
||||
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings{NoClient = true, ExtraPrototypes = Prototypes});
|
||||
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings
|
||||
{NoClient = true, ExtraPrototypes = Prototypes});
|
||||
var server = pairTracker.Pair.Server;
|
||||
|
||||
var testMap = await PoolManager.CreateTestMap(pairTracker);
|
||||
@@ -215,7 +219,7 @@ namespace Content.IntegrationTests.Tests.Buckle
|
||||
EntityUid human = default;
|
||||
BuckleComponent buckle = null;
|
||||
HandsComponent hands = null;
|
||||
SharedBodyComponent body = null;
|
||||
BodyComponent body = null;
|
||||
|
||||
await server.WaitIdleAsync();
|
||||
|
||||
@@ -260,12 +264,13 @@ namespace Content.IntegrationTests.Tests.Buckle
|
||||
Assert.NotNull(hand.HeldEntity);
|
||||
}
|
||||
|
||||
var legs = body.GetPartsOfType(BodyPartType.Leg);
|
||||
var bodySystem = entityManager.System<BodySystem>();
|
||||
var legs = bodySystem.GetBodyChildrenOfType(body.Owner, BodyPartType.Leg, body);
|
||||
|
||||
// Break our guy's kneecaps
|
||||
foreach (var leg in legs)
|
||||
{
|
||||
body.RemovePart(leg);
|
||||
bodySystem.DropPart(leg.Id, leg.Component);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -291,7 +296,8 @@ namespace Content.IntegrationTests.Tests.Buckle
|
||||
[Test]
|
||||
public async Task ForceUnbuckleBuckleTest()
|
||||
{
|
||||
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings{NoClient = true, ExtraPrototypes = Prototypes});
|
||||
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings
|
||||
{NoClient = true, ExtraPrototypes = Prototypes});
|
||||
var server = pairTracker.Pair.Server;
|
||||
|
||||
var testMap = await PoolManager.CreateTestMap(pairTracker);
|
||||
|
||||
@@ -9,7 +9,6 @@ using Content.Shared.Disposal;
|
||||
using NUnit.Framework;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Reflection;
|
||||
|
||||
namespace Content.IntegrationTests.Tests.Disposal
|
||||
@@ -78,9 +77,7 @@ namespace Content.IntegrationTests.Tests.Disposal
|
||||
id: HumanDummy
|
||||
components:
|
||||
- type: Body
|
||||
template: HumanoidTemplate
|
||||
preset: HumanPreset
|
||||
centerSlot: torso
|
||||
prototype: Human
|
||||
- type: MobState
|
||||
- type: Damageable
|
||||
damageContainer: Biological
|
||||
@@ -127,7 +124,8 @@ namespace Content.IntegrationTests.Tests.Disposal
|
||||
[Test]
|
||||
public async Task Test()
|
||||
{
|
||||
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings{NoClient = true, ExtraPrototypes = Prototypes});
|
||||
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings
|
||||
{NoClient = true, ExtraPrototypes = Prototypes});
|
||||
var server = pairTracker.Pair.Server;
|
||||
|
||||
var testMap = await PoolManager.CreateTestMap(pairTracker);
|
||||
@@ -147,7 +145,8 @@ namespace Content.IntegrationTests.Tests.Disposal
|
||||
human = entityManager.SpawnEntity("HumanDummy", coordinates);
|
||||
wrench = entityManager.SpawnEntity("WrenchDummy", coordinates);
|
||||
disposalUnit = entityManager.SpawnEntity("DisposalUnitDummy", coordinates);
|
||||
disposalTrunk = entityManager.SpawnEntity("DisposalTrunkDummy", IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(disposalUnit).MapPosition);
|
||||
disposalTrunk = entityManager.SpawnEntity("DisposalTrunkDummy",
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(disposalUnit).MapPosition);
|
||||
|
||||
// Test for components existing
|
||||
ref DisposalUnitComponent? comp = ref unit!;
|
||||
@@ -197,7 +196,7 @@ namespace Content.IntegrationTests.Tests.Disposal
|
||||
// Remove power need
|
||||
Assert.True(entityManager.TryGetComponent(disposalUnit, out ApcPowerReceiverComponent power));
|
||||
power!.NeedsPower = false;
|
||||
unit.Powered = true;//Power state changed event doesn't get fired smh
|
||||
unit.Powered = true; //Power state changed event doesn't get fired smh
|
||||
|
||||
// Flush with a mob and an item
|
||||
Flush(unit, true, human, wrench);
|
||||
|
||||
@@ -26,9 +26,7 @@ namespace Content.IntegrationTests.Tests.GameObjects.Components.ActionBlocking
|
||||
- type: Cuffable
|
||||
- type: Hands
|
||||
- type: Body
|
||||
template: HumanoidTemplate
|
||||
preset: HumanPreset
|
||||
centerSlot: torso
|
||||
prototype: Human
|
||||
|
||||
- type: entity
|
||||
name: HandcuffsDummy
|
||||
@@ -36,10 +34,12 @@ namespace Content.IntegrationTests.Tests.GameObjects.Components.ActionBlocking
|
||||
components:
|
||||
- type: Handcuff
|
||||
";
|
||||
|
||||
[Test]
|
||||
public async Task Test()
|
||||
{
|
||||
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings{NoClient = true, ExtraPrototypes = Prototypes});
|
||||
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings
|
||||
{NoClient = true, ExtraPrototypes = Prototypes});
|
||||
var server = pairTracker.Pair.Server;
|
||||
|
||||
EntityUid human;
|
||||
@@ -63,18 +63,21 @@ namespace Content.IntegrationTests.Tests.GameObjects.Components.ActionBlocking
|
||||
cuffs = entityManager.SpawnEntity("HandcuffsDummy", coordinates);
|
||||
secondCuffs = entityManager.SpawnEntity("HandcuffsDummy", coordinates);
|
||||
|
||||
entityManager.GetComponent<TransformComponent>(human).WorldPosition = entityManager.GetComponent<TransformComponent>(otherHuman).WorldPosition;
|
||||
entityManager.GetComponent<TransformComponent>(human).WorldPosition =
|
||||
entityManager.GetComponent<TransformComponent>(otherHuman).WorldPosition;
|
||||
|
||||
// Test for components existing
|
||||
Assert.True(entityManager.TryGetComponent(human, out cuffed!), $"Human has no {nameof(CuffableComponent)}");
|
||||
Assert.True(entityManager.TryGetComponent(human, out cuffed!),
|
||||
$"Human has no {nameof(CuffableComponent)}");
|
||||
Assert.True(entityManager.TryGetComponent(human, out hands!), $"Human has no {nameof(HandsComponent)}");
|
||||
Assert.True(entityManager.TryGetComponent(human, out SharedBodyComponent? _), $"Human has no {nameof(SharedBodyComponent)}");
|
||||
Assert.True(entityManager.TryGetComponent(human, out BodyComponent? _), $"Human has no {nameof(BodyComponent)}");
|
||||
Assert.True(entityManager.TryGetComponent(cuffs, out HandcuffComponent? _), $"Handcuff has no {nameof(HandcuffComponent)}");
|
||||
Assert.True(entityManager.TryGetComponent(secondCuffs, out HandcuffComponent? _), $"Second handcuffs has no {nameof(HandcuffComponent)}");
|
||||
|
||||
// Test to ensure cuffed players register the handcuffs
|
||||
cuffed.TryAddNewCuffs(human, cuffs);
|
||||
Assert.True(cuffed.CuffedHandCount > 0, "Handcuffing a player did not result in their hands being cuffed");
|
||||
Assert.True(cuffed.CuffedHandCount > 0,
|
||||
"Handcuffing a player did not result in their hands being cuffed");
|
||||
|
||||
// Test to ensure a player with 4 hands will still only have 2 hands cuffed
|
||||
AddHand(cuffed.Owner);
|
||||
@@ -86,7 +89,6 @@ namespace Content.IntegrationTests.Tests.GameObjects.Components.ActionBlocking
|
||||
// Test to give a player with 4 hands 2 sets of cuffs
|
||||
cuffed.TryAddNewCuffs(human, secondCuffs);
|
||||
Assert.True(cuffed.CuffedHandCount == 4, "Player doesn't have correct amount of hands cuffed");
|
||||
|
||||
});
|
||||
|
||||
await pairTracker.CleanReturnAsync();
|
||||
|
||||
Reference in New Issue
Block a user