Make mechanism behaviors properly update, fix eating and drinking (#2472)

* Make mechanisms properly update and fix eating and drinking

* Remove outdated component ignores

* Fix nullable error

* Fix mechanism behavior events

* Remove unnecessary code
This commit is contained in:
DrSmugleaf
2020-11-02 11:37:37 +01:00
committed by GitHub
parent 015539dcdc
commit 6b4a39006e
28 changed files with 326 additions and 306 deletions

View File

@@ -20,7 +20,7 @@ using Robust.Shared.Maths;
namespace Content.IntegrationTests.Tests.Body
{
[TestFixture]
[TestOf(typeof(LungBehaviorComponent))]
[TestOf(typeof(LungBehavior))]
public class LungTest : ContentIntegrationTest
{
[Test]
@@ -39,7 +39,7 @@ namespace Content.IntegrationTests.Tests.Body
var human = entityManager.SpawnEntity("HumanMob_Content", MapCoordinates.Nullspace);
Assert.That(human.TryGetComponent(out IBody body));
Assert.That(body.TryGetMechanismBehaviors(out List<LungBehaviorComponent> lungs));
Assert.That(body.TryGetMechanismBehaviors(out List<LungBehavior> lungs));
Assert.That(lungs.Count, Is.EqualTo(1));
Assert.That(human.TryGetComponent(out BloodstreamComponent bloodstream));
@@ -141,7 +141,7 @@ namespace Content.IntegrationTests.Tests.Body
human = entityManager.SpawnEntity("HumanMob_Content", coordinates);
Assert.True(human.TryGetComponent(out IBody body));
Assert.True(body.HasMechanismBehavior<LungBehaviorComponent>());
Assert.True(body.HasMechanismBehavior<LungBehavior>());
Assert.True(human.TryGetComponent(out metabolism));
Assert.False(metabolism.Suffocating);
});