Predict dumping (#32394)
* Predict dumping - This got soaped really fucking hard. - Dumping is predicted, this required disposals to be predicte.d - Disposals required mailing (because it's tightly coupled), and a smidge of other content systems. - I also had to fix a compnetworkgenerator issue at the same time so it wouldn't mispredict. * Fix a bunch of stuff * nasty merge * Some reviews * Some more reviews while I stash * Fix merge * Fix merge * Half of review * Review * re(h)f * lizards * feexes * feex
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
#nullable enable annotations
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using Content.Server.Disposal.Tube.Components;
|
||||
using Content.Server.Disposal.Unit.Components;
|
||||
using Content.Server.Disposal.Unit.EntitySystems;
|
||||
using Content.Server.Disposal.Unit;
|
||||
using Content.Server.Power.Components;
|
||||
using Content.Shared.Disposal;
|
||||
using Content.Server.Power.EntitySystems;
|
||||
using Content.Shared.Disposal.Components;
|
||||
using NUnit.Framework;
|
||||
using Content.Shared.Disposal.Tube;
|
||||
using Content.Shared.Disposal.Unit;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Reflection;
|
||||
|
||||
@@ -30,7 +29,6 @@ namespace Content.IntegrationTests.Tests.Disposal
|
||||
{
|
||||
var (_, toInsert, unit) = ev;
|
||||
var insertTransform = EntityManager.GetComponent<TransformComponent>(toInsert);
|
||||
var unitTransform = EntityManager.GetComponent<TransformComponent>(unit);
|
||||
// Not in a tube yet
|
||||
Assert.That(insertTransform.ParentUid, Is.EqualTo(unit));
|
||||
}, after: new[] { typeof(SharedDisposalUnitSystem) });
|
||||
@@ -163,6 +161,8 @@ namespace Content.IntegrationTests.Tests.Disposal
|
||||
var entityManager = server.ResolveDependency<IEntityManager>();
|
||||
var xformSystem = entityManager.System<SharedTransformSystem>();
|
||||
var disposalSystem = entityManager.System<DisposalUnitSystem>();
|
||||
var power = entityManager.System<PowerReceiverSystem>();
|
||||
|
||||
await server.WaitAssertion(() =>
|
||||
{
|
||||
// Spawn the entities
|
||||
@@ -191,7 +191,7 @@ namespace Content.IntegrationTests.Tests.Disposal
|
||||
xformSystem.AnchorEntity(unitUid, entityManager.GetComponent<TransformComponent>(unitUid));
|
||||
|
||||
// No power
|
||||
Assert.That(unitComponent.Powered, Is.False);
|
||||
Assert.That(power.IsPowered(unitUid), Is.False);
|
||||
|
||||
// Can't insert the trunk or the unit into itself
|
||||
UnitInsertContains(unitUid, unitComponent, false, disposalSystem, disposalUnit, disposalTrunk);
|
||||
@@ -227,9 +227,9 @@ namespace Content.IntegrationTests.Tests.Disposal
|
||||
await server.WaitAssertion(() =>
|
||||
{
|
||||
// Remove power need
|
||||
Assert.That(entityManager.TryGetComponent(disposalUnit, out ApcPowerReceiverComponent power));
|
||||
power!.NeedsPower = false;
|
||||
unitComponent.Powered = true; //Power state changed event doesn't get fired smh
|
||||
Assert.That(entityManager.TryGetComponent(disposalUnit, out ApcPowerReceiverComponent powerComp));
|
||||
power.SetNeedsPower(disposalUnit, false);
|
||||
powerComp.Powered = true;
|
||||
|
||||
// Flush with a mob and an item
|
||||
Flush(disposalUnit, unitComponent, true, disposalSystem, human, wrench);
|
||||
|
||||
Reference in New Issue
Block a user