Fix humanoid appearance error (#13721)

This commit is contained in:
Leon Friedrich
2023-01-27 11:04:58 +13:00
committed by GitHub
parent f27e7dd4d6
commit e8838af395
4 changed files with 46 additions and 28 deletions

View File

@@ -114,9 +114,9 @@ public sealed class HumanoidAppearanceState : ComponentState
[Serializable, NetSerializable]
public readonly struct CustomBaseLayerInfo
{
public CustomBaseLayerInfo(string id, Color? color = null)
public CustomBaseLayerInfo(string? id, Color? color = null)
{
DebugTools.Assert(IoCManager.Resolve<IPrototypeManager>().HasIndex<HumanoidSpeciesSpriteLayer>(id));
DebugTools.Assert(id == null || IoCManager.Resolve<IPrototypeManager>().HasIndex<HumanoidSpeciesSpriteLayer>(id));
ID = id;
Color = color;
}
@@ -124,11 +124,11 @@ public sealed class HumanoidAppearanceState : ComponentState
/// <summary>
/// ID of this custom base layer. Must be a <see cref="HumanoidSpeciesSpriteLayer"/>.
/// </summary>
[DataField("id", customTypeSerializer: typeof(PrototypeIdSerializer<HumanoidSpeciesSpriteLayer>), required: true)]
public string ID { init; get; }
[DataField("id", customTypeSerializer: typeof(PrototypeIdSerializer<HumanoidSpeciesSpriteLayer>))]
public string? ID { init; get; }
/// <summary>
/// Color of this custom base layer. Null implies skin colour.
/// Color of this custom base layer. Null implies skin colour if the corresponding <see cref="HumanoidSpeciesSpriteLayer"/> is set to match skin.
/// </summary>
[DataField("color")]
public Color? Color { init; get; }