From 17521c9cd7e9998e32fcff9e9bb9985065dfc5e2 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Tue, 24 Aug 2021 23:24:06 -0700 Subject: [PATCH] fix: Adds defaults for codegenned clothing (#727) --- Projects/UOContent/Items/Clothing/BaseClothing.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Projects/UOContent/Items/Clothing/BaseClothing.cs b/Projects/UOContent/Items/Clothing/BaseClothing.cs index bac0c4e6b..dee1c8224 100644 --- a/Projects/UOContent/Items/Clothing/BaseClothing.cs +++ b/Projects/UOContent/Items/Clothing/BaseClothing.cs @@ -35,6 +35,9 @@ namespace Server.Items [SerializableFieldSaveFlag(1)] private bool ShouldSerializeAttributes() => !_attributes.IsEmpty; + [SerializableFieldDefault(1)] + private AosAttributes AttributesDefaultValue() => new(this); + [SerializableField(2, setter: "private")] [SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster, canModify: true)]")] private AosArmorAttributes _clothingAttributes; @@ -42,6 +45,9 @@ namespace Server.Items [SerializableFieldSaveFlag(2)] private bool ShouldSerializeClothingAttributes() => !_clothingAttributes.IsEmpty; + [SerializableFieldDefault(2)] + private AosArmorAttributes ClothingAttributesDefaultValue() => new(this); + [SerializableField(3, setter: "private")] [SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster, canModify: true)]")] private AosSkillBonuses _skillBonuses; @@ -49,6 +55,9 @@ namespace Server.Items [SerializableFieldSaveFlag(3)] private bool ShouldSerializeSkillBonuses() => !_skillBonuses.IsEmpty; + [SerializableFieldDefault(3)] + private AosSkillBonuses SkillBonusesDefaultValue() => new(this); + [SerializableField(4, setter: "private")] [SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster, canModify: true)]")] private AosElementAttributes _resistances; @@ -56,6 +65,9 @@ namespace Server.Items [SerializableFieldSaveFlag(4)] private bool ShouldSerializeResistances() => !_resistances.IsEmpty; + [SerializableFieldDefault(4)] + private AosElementAttributes ResistancesDefaultValue() => new(this); + [EncodedInt] [InvalidateProperties] [SerializableField(5)]