Content update for NetEntities (#18935)

This commit is contained in:
metalgearsloth
2023-09-11 09:42:41 +10:00
committed by GitHub
parent 389c8d1a2c
commit 5a0fc68be2
526 changed files with 3058 additions and 2215 deletions

View File

@@ -38,7 +38,7 @@ public partial class SharedBodySystem
var prototype = Prototypes.Index<BodyPrototype>(body.Prototype);
if (!_netManager.IsClient || bodyId.IsClientSide())
if (!_netManager.IsClient || IsClientSide(bodyId))
InitBody(body, prototype);
Dirty(body); // Client doesn't actually spawn the body, need to sync it
@@ -72,7 +72,12 @@ public partial class SharedBodySystem
body.Root != null)
return false;
slot = new BodyPartSlot(slotId, bodyId.Value, null);
slot = new BodyPartSlot
{
Id = slotId,
Parent = bodyId.Value,
NetParent = GetNetEntity(bodyId.Value),
};
body.Root = slot;
return true;
@@ -86,7 +91,13 @@ public partial class SharedBodySystem
return;
var bodyId = Spawn(root.Part, body.Owner.ToCoordinates());
var partComponent = Comp<BodyPartComponent>(bodyId);
var slot = new BodyPartSlot(root.Part, body.Owner, partComponent.PartType);
var slot = new BodyPartSlot
{
Id = root.Part,
Type = partComponent.PartType,
Parent = body.Owner,
NetParent = GetNetEntity(body.Owner),
};
body.Root = slot;
partComponent.Body = bodyId;