- fix: Height on cline and some stuff
This commit is contained in:
@@ -182,6 +182,13 @@ public sealed partial class HumanoidAppearanceSystem : SharedHumanoidAppearanceS
|
|||||||
grammar.Gender = sourceHumanoid.Gender;
|
grammar.Gender = sourceHumanoid.Gender;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AMOUR START
|
||||||
|
var ev = new HumanoidAppearanceClonedEvent(
|
||||||
|
new Entity<HumanoidAppearanceComponent>(source,sourceHumanoid),
|
||||||
|
new Entity<HumanoidAppearanceComponent>(target,targetHumanoid));
|
||||||
|
RaiseLocalEvent(source, ev);
|
||||||
|
// AMOUR END
|
||||||
|
|
||||||
Dirty(targetHumanoid);
|
Dirty(targetHumanoid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,15 @@ public abstract class SharedCustomHeightSystem : EntitySystem
|
|||||||
base.Initialize();
|
base.Initialize();
|
||||||
SubscribeLocalEvent<CustomHeightComponent,ComponentInit>(OnInit);
|
SubscribeLocalEvent<CustomHeightComponent,ComponentInit>(OnInit);
|
||||||
SubscribeLocalEvent<CustomHeightComponent,HumanoidAppearanceLoadedEvent>(OnLoaded);
|
SubscribeLocalEvent<CustomHeightComponent,HumanoidAppearanceLoadedEvent>(OnLoaded);
|
||||||
|
SubscribeLocalEvent<CustomHeightComponent,HumanoidAppearanceClonedEvent>(OnCloned);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnCloned(EntityUid uid, CustomHeightComponent component, HumanoidAppearanceClonedEvent args)
|
||||||
|
{
|
||||||
|
if(!AppearanceSystem.TryGetData<float>(uid, HeightVisuals.State, out var height))
|
||||||
|
return;
|
||||||
|
|
||||||
|
SetHeight(args.Target.Owner,height);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnLoaded(EntityUid uid, CustomHeightComponent component, HumanoidAppearanceLoadedEvent args)
|
private void OnLoaded(EntityUid uid, CustomHeightComponent component, HumanoidAppearanceLoadedEvent args)
|
||||||
|
|||||||
@@ -13,6 +13,21 @@ public abstract partial class SharedHoleSystem
|
|||||||
{
|
{
|
||||||
SubscribeLocalEvent<HoleContainerComponent,ComponentInit>(OnContainerInit);
|
SubscribeLocalEvent<HoleContainerComponent,ComponentInit>(OnContainerInit);
|
||||||
SubscribeLocalEvent<HoleContainerComponent,HumanoidAppearanceLoadedEvent>(OnAppearanceLoaded);
|
SubscribeLocalEvent<HoleContainerComponent,HumanoidAppearanceLoadedEvent>(OnAppearanceLoaded);
|
||||||
|
SubscribeLocalEvent<HoleContainerComponent, HumanoidAppearanceClonedEvent>(OnClone);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnClone(EntityUid uid, HoleContainerComponent component, HumanoidAppearanceClonedEvent args)
|
||||||
|
{
|
||||||
|
var holeContainerComponent = EnsureComp<HoleContainerComponent>(args.Target);
|
||||||
|
foreach (var entity in component.Slot.ContainedEntities)
|
||||||
|
{
|
||||||
|
var meta = MetaData(entity);
|
||||||
|
if(meta.EntityPrototype is null || !TryComp<HoleComponent>(entity, out var holeComponent))
|
||||||
|
continue;
|
||||||
|
AddHole(new Entity<HoleContainerComponent?>(args.Target,holeContainerComponent), meta.EntityPrototype.ID, holeComponent.Layers[0].Color);
|
||||||
|
}
|
||||||
|
|
||||||
|
Dirty(args.Target,holeContainerComponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnAppearanceLoaded(EntityUid uid, HoleContainerComponent component, HumanoidAppearanceLoadedEvent args)
|
private void OnAppearanceLoaded(EntityUid uid, HoleContainerComponent component, HumanoidAppearanceLoadedEvent args)
|
||||||
@@ -55,6 +70,6 @@ public abstract partial class SharedHoleSystem
|
|||||||
entity.Comp.MainHole = GetNetEntity(spawned);
|
entity.Comp.MainHole = GetNetEntity(spawned);
|
||||||
|
|
||||||
_containerSystem.Insert(spawned, entity.Comp.Slot);
|
_containerSystem.Insert(spawned, entity.Comp.Slot);
|
||||||
Dirty(entity);
|
Dirty(spawned,component);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,3 +11,7 @@ public record struct HumanoidAppearanceLoadingEvent(
|
|||||||
public record struct HumanoidAppearanceLoadedEvent(
|
public record struct HumanoidAppearanceLoadedEvent(
|
||||||
Entity<HumanoidAppearanceComponent> Entity,
|
Entity<HumanoidAppearanceComponent> Entity,
|
||||||
HumanoidCharacterProfile Profile);
|
HumanoidCharacterProfile Profile);
|
||||||
|
|
||||||
|
public record struct HumanoidAppearanceClonedEvent(
|
||||||
|
Entity<HumanoidAppearanceComponent> Source,
|
||||||
|
Entity<HumanoidAppearanceComponent> Target);
|
||||||
|
|||||||
Reference in New Issue
Block a user