diff --git a/Content.Server/Humanoid/Systems/HumanoidAppearanceSystem.cs b/Content.Server/Humanoid/Systems/HumanoidAppearanceSystem.cs index 0e176a0f98..05913d1768 100644 --- a/Content.Server/Humanoid/Systems/HumanoidAppearanceSystem.cs +++ b/Content.Server/Humanoid/Systems/HumanoidAppearanceSystem.cs @@ -182,6 +182,13 @@ public sealed partial class HumanoidAppearanceSystem : SharedHumanoidAppearanceS grammar.Gender = sourceHumanoid.Gender; } + // AMOUR START + var ev = new HumanoidAppearanceClonedEvent( + new Entity(source,sourceHumanoid), + new Entity(target,targetHumanoid)); + RaiseLocalEvent(source, ev); + // AMOUR END + Dirty(targetHumanoid); } diff --git a/Content.Shared/_Amour/CustomHeight/CustomHeightSystem.cs b/Content.Shared/_Amour/CustomHeight/CustomHeightSystem.cs index d41ce7172f..f3bea6d50f 100644 --- a/Content.Shared/_Amour/CustomHeight/CustomHeightSystem.cs +++ b/Content.Shared/_Amour/CustomHeight/CustomHeightSystem.cs @@ -15,6 +15,15 @@ public abstract class SharedCustomHeightSystem : EntitySystem base.Initialize(); SubscribeLocalEvent(OnInit); SubscribeLocalEvent(OnLoaded); + SubscribeLocalEvent(OnCloned); + } + + private void OnCloned(EntityUid uid, CustomHeightComponent component, HumanoidAppearanceClonedEvent args) + { + if(!AppearanceSystem.TryGetData(uid, HeightVisuals.State, out var height)) + return; + + SetHeight(args.Target.Owner,height); } private void OnLoaded(EntityUid uid, CustomHeightComponent component, HumanoidAppearanceLoadedEvent args) diff --git a/Content.Shared/_Amour/Hole/HoleSystem.Container.cs b/Content.Shared/_Amour/Hole/HoleSystem.Container.cs index 35a011be6d..e864817fad 100644 --- a/Content.Shared/_Amour/Hole/HoleSystem.Container.cs +++ b/Content.Shared/_Amour/Hole/HoleSystem.Container.cs @@ -13,6 +13,21 @@ public abstract partial class SharedHoleSystem { SubscribeLocalEvent(OnContainerInit); SubscribeLocalEvent(OnAppearanceLoaded); + SubscribeLocalEvent(OnClone); + } + + private void OnClone(EntityUid uid, HoleContainerComponent component, HumanoidAppearanceClonedEvent args) + { + var holeContainerComponent = EnsureComp(args.Target); + foreach (var entity in component.Slot.ContainedEntities) + { + var meta = MetaData(entity); + if(meta.EntityPrototype is null || !TryComp(entity, out var holeComponent)) + continue; + AddHole(new Entity(args.Target,holeContainerComponent), meta.EntityPrototype.ID, holeComponent.Layers[0].Color); + } + + Dirty(args.Target,holeContainerComponent); } private void OnAppearanceLoaded(EntityUid uid, HoleContainerComponent component, HumanoidAppearanceLoadedEvent args) @@ -55,6 +70,6 @@ public abstract partial class SharedHoleSystem entity.Comp.MainHole = GetNetEntity(spawned); _containerSystem.Insert(spawned, entity.Comp.Slot); - Dirty(entity); + Dirty(spawned,component); } } diff --git a/Content.Shared/_Amour/HumanoidAppearanceExtension/HumanoidAppearanceLoading.cs b/Content.Shared/_Amour/HumanoidAppearanceExtension/HumanoidAppearanceLoading.cs index 504d764349..06a5c624be 100644 --- a/Content.Shared/_Amour/HumanoidAppearanceExtension/HumanoidAppearanceLoading.cs +++ b/Content.Shared/_Amour/HumanoidAppearanceExtension/HumanoidAppearanceLoading.cs @@ -11,3 +11,7 @@ public record struct HumanoidAppearanceLoadingEvent( public record struct HumanoidAppearanceLoadedEvent( Entity Entity, HumanoidCharacterProfile Profile); + +public record struct HumanoidAppearanceClonedEvent( + Entity Source, + Entity Target);