serv4 + submodule update (#12740)

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
This commit is contained in:
Paul Ritter
2022-11-27 19:25:55 +01:00
committed by GitHub
parent 7608c24b63
commit 3884c4d3db
46 changed files with 230 additions and 302 deletions

View File

@@ -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");

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;
}