mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-29 23:57:29 +00:00
Decouple gibbing from the body system (#42405)
* Decouple gibbing from the body system * allow gibs that don't drop giblets * pass through user * prediction gon * comment * destructible * playpvs * very very very very very very very minor cleanup --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
This commit is contained in:
committed by
BarryNorfolk
co-authored by
Princess Cheeseballs
parent
3f34d833fb
commit
66ddb7473f
@@ -1,43 +0,0 @@
|
||||
#nullable enable
|
||||
using Content.Server.Body.Systems;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.IntegrationTests.Tests.Body;
|
||||
|
||||
[TestFixture]
|
||||
public sealed class GibTest
|
||||
{
|
||||
[Test]
|
||||
public async Task TestGib()
|
||||
{
|
||||
await using var pair = await PoolManager.GetServerClient(new PoolSettings { Connected = true });
|
||||
var (server, client) = (pair.Server, pair.Client);
|
||||
var map = await pair.CreateTestMap();
|
||||
|
||||
EntityUid target1 = default;
|
||||
EntityUid target2 = default;
|
||||
|
||||
await server.WaitAssertion(() => target1 = server.EntMan.Spawn("MobHuman", map.MapCoords));
|
||||
await server.WaitAssertion(() => target2 = server.EntMan.Spawn("MobHuman", map.MapCoords));
|
||||
await pair.WaitCommand($"setoutfit {server.EntMan.GetNetEntity(target1)} CaptainGear");
|
||||
await pair.WaitCommand($"setoutfit {server.EntMan.GetNetEntity(target2)} CaptainGear");
|
||||
|
||||
await pair.RunTicksSync(5);
|
||||
var nuid1 = pair.ToClientUid(target1);
|
||||
var nuid2 = pair.ToClientUid(target2);
|
||||
Assert.That(client.EntMan.EntityExists(nuid1));
|
||||
Assert.That(client.EntMan.EntityExists(nuid2));
|
||||
|
||||
await server.WaitAssertion(() => server.System<BodySystem>().GibBody(target1, acidify: false));
|
||||
await server.WaitAssertion(() => server.System<BodySystem>().GibBody(target2, acidify: true));
|
||||
|
||||
await pair.RunTicksSync(5);
|
||||
await pair.WaitCommand("dirty");
|
||||
await pair.RunTicksSync(5);
|
||||
|
||||
Assert.That(!client.EntMan.EntityExists(nuid1));
|
||||
Assert.That(!client.EntMan.EntityExists(nuid2));
|
||||
|
||||
await pair.CleanReturnAsync();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
#nullable enable
|
||||
using Content.Shared.Gibbing;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.IntegrationTests.Tests.Body;
|
||||
|
||||
[TestFixture]
|
||||
public sealed class GibTest
|
||||
{
|
||||
[Test]
|
||||
public async Task TestGib()
|
||||
{
|
||||
await using var pair = await PoolManager.GetServerClient(new PoolSettings { Connected = true });
|
||||
var (server, client) = (pair.Server, pair.Client);
|
||||
var map = await pair.CreateTestMap();
|
||||
|
||||
EntityUid target = default;
|
||||
|
||||
await server.WaitAssertion(() => target = server.EntMan.Spawn("MobHuman", map.MapCoords));
|
||||
await pair.WaitCommand($"setoutfit {server.EntMan.GetNetEntity(target)} CaptainGear");
|
||||
|
||||
await pair.RunTicksSync(5);
|
||||
var nuid = pair.ToClientUid(target);
|
||||
Assert.That(client.EntMan.EntityExists(nuid));
|
||||
|
||||
await server.WaitAssertion(() => server.System<GibbingSystem>().Gib(target));
|
||||
|
||||
await pair.RunTicksSync(5);
|
||||
await pair.WaitCommand("dirty");
|
||||
await pair.RunTicksSync(5);
|
||||
|
||||
Assert.That(!client.EntMan.EntityExists(nuid));
|
||||
|
||||
await pair.CleanReturnAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user