Content fixes for engine PR (#39086)

* content changes for engine PR

* rerun tests
This commit is contained in:
slarticodefast
2025-07-22 12:25:28 +02:00
committed by GitHub
parent ed6ed6c5f3
commit 9a7cb00d4e
14 changed files with 16 additions and 89 deletions

View File

@@ -1,6 +1,4 @@
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Sound.Components;
@@ -13,25 +11,13 @@ public abstract partial class BaseEmitSoundComponent : Component
/// <summary>
/// The <see cref="SoundSpecifier"/> to play.
/// </summary>
[DataField(required: true)]
[DataField(required: true), AutoNetworkedField]
public SoundSpecifier? Sound;
/// <summary>
/// Play the sound at the position instead of parented to the source entity.
/// Useful if the entity is deleted after.
/// </summary>
[DataField]
[DataField, AutoNetworkedField]
public bool Positional;
}
/// <summary>
/// Represents the state of <see cref="BaseEmitSoundComponent"/>.
/// </summary>
/// <remarks>This is obviously very cursed, but since the BaseEmitSoundComponent is abstract, we cannot network it.
/// AutoGenerateComponentState attribute won't work here, and since everything revolves around inheritance for some fucking reason,
/// there's no better way of doing this.</remarks>
[Serializable, NetSerializable]
public struct EmitSoundComponentState(SoundSpecifier? sound) : IComponentState
{
public SoundSpecifier? Sound { get; } = sound;
}