mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-29 23:57:29 +00:00
Fix humanoid profile voice being broken (#42550)
Fix humanoid appearance voice being broken
This commit is contained in:
committed by
Coryler
parent
e19f4643f2
commit
dd43910f79
@@ -0,0 +1,49 @@
|
||||
using Content.Shared.Humanoid;
|
||||
using Content.Shared.Humanoid.Prototypes;
|
||||
using Content.Shared.Preferences;
|
||||
using Content.Shared.Speech.Components;
|
||||
using Robust.Shared.Enums;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.IntegrationTests.Tests.Humanoid;
|
||||
|
||||
[TestFixture]
|
||||
[TestOf(typeof(HumanoidProfileSystem))]
|
||||
public sealed class HumanoidProfileTests
|
||||
{
|
||||
private static readonly ProtoId<SpeciesPrototype> Vox = "Vox";
|
||||
|
||||
[Test]
|
||||
public async Task EnsureValidLoading()
|
||||
{
|
||||
await using var pair = await PoolManager.GetServerClient();
|
||||
var server = pair.Server;
|
||||
|
||||
await server.WaitIdleAsync();
|
||||
|
||||
await server.WaitAssertion(() =>
|
||||
{
|
||||
var entityManager = server.ResolveDependency<IEntityManager>();
|
||||
var humanoidProfile = entityManager.System<HumanoidProfileSystem>();
|
||||
var human = entityManager.Spawn("MobHuman");
|
||||
humanoidProfile.ApplyProfileTo(human, new HumanoidCharacterProfile()
|
||||
.WithSex(Sex.Female)
|
||||
.WithAge(67)
|
||||
.WithGender(Gender.Neuter)
|
||||
.WithSpecies(Vox));
|
||||
var humanoidComponent = entityManager.GetComponent<HumanoidProfileComponent>(human);
|
||||
var voiceComponent = entityManager.GetComponent<VocalComponent>(human);
|
||||
|
||||
Assert.That(humanoidComponent.Age, Is.EqualTo(67));
|
||||
Assert.That(humanoidComponent.Sex, Is.EqualTo(Sex.Female));
|
||||
Assert.That(humanoidComponent.Gender, Is.EqualTo(Gender.Neuter));
|
||||
Assert.That(humanoidComponent.Species, Is.EqualTo(Vox));
|
||||
|
||||
Assert.That(voiceComponent.Sounds, Is.Not.Null, message: "the MobHuman spawned by this test needs to have sex-specific sound set");
|
||||
Assert.That(voiceComponent.Sounds![Sex.Female], Is.EqualTo(voiceComponent.EmoteSounds));
|
||||
});
|
||||
|
||||
await pair.CleanReturnAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user