serv4 + submodule update (#12740)
Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
This commit is contained in:
@@ -16,7 +16,7 @@ public sealed class BodyComponent : Component, IDraggable
|
||||
public readonly string? Prototype;
|
||||
|
||||
[DataField("root")]
|
||||
public BodyPartSlot Root = default!;
|
||||
public BodyPartSlot? Root;
|
||||
|
||||
[DataField("gibSound")]
|
||||
public SoundSpecifier GibSound = new SoundCollectionSpecifier("gib");
|
||||
|
||||
@@ -7,10 +7,10 @@ namespace Content.Shared.Body.Components;
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class BodyComponentState : ComponentState
|
||||
{
|
||||
public readonly BodyPartSlot Root;
|
||||
public readonly BodyPartSlot? Root;
|
||||
public readonly SoundSpecifier GibSound;
|
||||
|
||||
public BodyComponentState(BodyPartSlot root, SoundSpecifier gibSound)
|
||||
public BodyComponentState(BodyPartSlot? root, SoundSpecifier gibSound)
|
||||
{
|
||||
Root = root;
|
||||
GibSound = gibSound;
|
||||
|
||||
@@ -125,8 +125,10 @@ public sealed class BodyPrototypeSerializer : ITypeReader<BodyPrototype, Mapping
|
||||
return new ValidatedSequenceNode(nodes);
|
||||
}
|
||||
|
||||
public BodyPrototype Read(ISerializationManager serializationManager, MappingDataNode node, IDependencyCollection dependencies,
|
||||
bool skipHook, ISerializationContext? context = null, BodyPrototype? value = default)
|
||||
public BodyPrototype Read(ISerializationManager serializationManager, MappingDataNode node,
|
||||
IDependencyCollection dependencies,
|
||||
bool skipHook, ISerializationContext? context = null,
|
||||
ISerializationManager.InstantiationDelegate<BodyPrototype>? instanceProvider = null)
|
||||
{
|
||||
var id = node.Get<ValueDataNode>("id").Value;
|
||||
var name = node.Get<ValueDataNode>("name").Value;
|
||||
|
||||
@@ -125,7 +125,7 @@ public partial class SharedBodySystem
|
||||
{
|
||||
if (id == null ||
|
||||
!Resolve(id.Value, ref body, false) ||
|
||||
!TryComp(body.Root.Child, out BodyPartComponent? part))
|
||||
!TryComp(body.Root?.Child, out BodyPartComponent? part))
|
||||
yield break;
|
||||
|
||||
yield return (body.Root.Child.Value, part);
|
||||
@@ -155,7 +155,7 @@ public partial class SharedBodySystem
|
||||
if (bodyId == null || !Resolve(bodyId.Value, ref body, false))
|
||||
yield break;
|
||||
|
||||
foreach (var slot in GetPartAllSlots(body.Root.Child))
|
||||
foreach (var slot in GetPartAllSlots(body.Root?.Child))
|
||||
{
|
||||
yield return slot;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user