mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-30 20:17:32 +03:00
Revert "Pulling rework (#20906)" This reverts commit 0d8254b2a2891f8d5623c9878bd0e567d0c7fe3c. (cherry picked from commit c15b0691ec452e543a3cc6894a28bb409dbc65f8)
46 lines
1.4 KiB
C#
46 lines
1.4 KiB
C#
using Content.Shared.Hands.Components;
|
|
using Content.Shared.Prototypes;
|
|
using Content.Shared.Pulling.Components;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.IntegrationTests.Tests.Puller;
|
|
|
|
#nullable enable
|
|
|
|
[TestFixture]
|
|
public sealed class PullerTest
|
|
{
|
|
/// <summary>
|
|
/// Checks that needsHands on PullerComponent is not set on mobs that don't even have hands.
|
|
/// </summary>
|
|
[Test]
|
|
public async Task PullerSanityTest()
|
|
{
|
|
await using var pair = await PoolManager.GetServerClient();
|
|
var server = pair.Server;
|
|
|
|
var compFactory = server.ResolveDependency<IComponentFactory>();
|
|
var protoManager = server.ResolveDependency<IPrototypeManager>();
|
|
|
|
await server.WaitAssertion(() =>
|
|
{
|
|
Assert.Multiple(() =>
|
|
{
|
|
foreach (var proto in protoManager.EnumeratePrototypes<EntityPrototype>())
|
|
{
|
|
if (!proto.TryGetComponent(out SharedPullerComponent? puller))
|
|
continue;
|
|
|
|
if (!puller.NeedsHands)
|
|
continue;
|
|
|
|
Assert.That(proto.HasComponent<HandsComponent>(compFactory), $"Found puller {proto} with NeedsHand pulling but has no hands?");
|
|
}
|
|
});
|
|
});
|
|
|
|
await pair.CleanReturnAsync();
|
|
}
|
|
}
|