From ecd145b2744f589801be40e6fd68e05e2024b69d Mon Sep 17 00:00:00 2001 From: Doru991 <75124791+Doru991@users.noreply.github.com> Date: Wed, 23 Aug 2023 07:51:59 +0300 Subject: [PATCH] Fix zombie eye appearance (#19427) --- Content.Server/Zombies/ZombieSystem.Transform.cs | 5 ++++- Content.Server/Zombies/ZombieSystem.cs | 7 ++++++- Content.Shared/Zombies/ZombieComponent.cs | 6 ++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Content.Server/Zombies/ZombieSystem.Transform.cs b/Content.Server/Zombies/ZombieSystem.Transform.cs index d979639f88..d504ca1a11 100644 --- a/Content.Server/Zombies/ZombieSystem.Transform.cs +++ b/Content.Server/Zombies/ZombieSystem.Transform.cs @@ -133,12 +133,15 @@ namespace Content.Server.Zombies { //store some values before changing them in case the humanoid get cloned later zombiecomp.BeforeZombifiedSkinColor = huApComp.SkinColor; + zombiecomp.BeforeZombifiedEyeColor = huApComp.EyeColor; zombiecomp.BeforeZombifiedCustomBaseLayers = new(huApComp.CustomBaseLayers); if (TryComp(target, out var stream)) zombiecomp.BeforeZombifiedBloodReagent = stream.BloodReagent; _humanoidAppearance.SetSkinColor(target, zombiecomp.SkinColor, verify: false, humanoid: huApComp); - _humanoidAppearance.SetBaseLayerColor(target, HumanoidVisualLayers.Eyes, zombiecomp.EyeColor, humanoid: huApComp); + + // Messing with the eye layer made it vanish upon cloning, and also it didn't even appear right + huApComp.EyeColor = zombiecomp.EyeColor; // this might not resync on clone? _humanoidAppearance.SetBaseLayerId(target, HumanoidVisualLayers.Tail, zombiecomp.BaseLayerExternal, humanoid: huApComp); diff --git a/Content.Server/Zombies/ZombieSystem.cs b/Content.Server/Zombies/ZombieSystem.cs index 659bc16414..7b71a429cf 100644 --- a/Content.Server/Zombies/ZombieSystem.cs +++ b/Content.Server/Zombies/ZombieSystem.cs @@ -20,6 +20,7 @@ using Content.Shared.Zombies; using Robust.Shared.Prototypes; using Robust.Shared.Random; using Robust.Shared.Timing; +using Content.Shared.Humanoid; namespace Content.Server.Zombies { @@ -256,7 +257,11 @@ namespace Content.Server.Zombies _humanoidAppearance.SetBaseLayerColor(target, layer, info.Color); _humanoidAppearance.SetBaseLayerId(target, layer, info.ID); } - _humanoidAppearance.SetSkinColor(target, zombiecomp.BeforeZombifiedSkinColor); + if(TryComp(target, out var appcomp)) + { + appcomp.EyeColor = zombiecomp.BeforeZombifiedEyeColor; + } + _humanoidAppearance.SetSkinColor(target, zombiecomp.BeforeZombifiedSkinColor, false); _bloodstream.ChangeBloodReagent(target, zombiecomp.BeforeZombifiedBloodReagent); _metaData.SetEntityName(target, zombiecomp.BeforeZombifiedEntityName); diff --git a/Content.Shared/Zombies/ZombieComponent.cs b/Content.Shared/Zombies/ZombieComponent.cs index 7be1254021..f03a0baf79 100644 --- a/Content.Shared/Zombies/ZombieComponent.cs +++ b/Content.Shared/Zombies/ZombieComponent.cs @@ -80,6 +80,12 @@ public sealed partial class ZombieComponent : Component [DataField("beforeZombifiedSkinColor")] public Color BeforeZombifiedSkinColor; + /// + /// The eye color of the humanoid to restore in case of cloning + /// + [DataField("beforeZombifiedEyeColor")] + public Color BeforeZombifiedEyeColor; + [DataField("emoteId", customTypeSerializer: typeof(PrototypeIdSerializer))] public string? EmoteSoundsId = "Zombie";