fix: Adds defaults for codegenned clothing (#727)

This commit is contained in:
Kamron Batman 2021-08-24 23:24:06 -07:00 committed by GitHub
parent ca3faec01d
commit 17521c9cd7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,6 +35,9 @@ namespace Server.Items
[SerializableFieldSaveFlag(1)] [SerializableFieldSaveFlag(1)]
private bool ShouldSerializeAttributes() => !_attributes.IsEmpty; private bool ShouldSerializeAttributes() => !_attributes.IsEmpty;
[SerializableFieldDefault(1)]
private AosAttributes AttributesDefaultValue() => new(this);
[SerializableField(2, setter: "private")] [SerializableField(2, setter: "private")]
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster, canModify: true)]")] [SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster, canModify: true)]")]
private AosArmorAttributes _clothingAttributes; private AosArmorAttributes _clothingAttributes;
@ -42,6 +45,9 @@ namespace Server.Items
[SerializableFieldSaveFlag(2)] [SerializableFieldSaveFlag(2)]
private bool ShouldSerializeClothingAttributes() => !_clothingAttributes.IsEmpty; private bool ShouldSerializeClothingAttributes() => !_clothingAttributes.IsEmpty;
[SerializableFieldDefault(2)]
private AosArmorAttributes ClothingAttributesDefaultValue() => new(this);
[SerializableField(3, setter: "private")] [SerializableField(3, setter: "private")]
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster, canModify: true)]")] [SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster, canModify: true)]")]
private AosSkillBonuses _skillBonuses; private AosSkillBonuses _skillBonuses;
@ -49,6 +55,9 @@ namespace Server.Items
[SerializableFieldSaveFlag(3)] [SerializableFieldSaveFlag(3)]
private bool ShouldSerializeSkillBonuses() => !_skillBonuses.IsEmpty; private bool ShouldSerializeSkillBonuses() => !_skillBonuses.IsEmpty;
[SerializableFieldDefault(3)]
private AosSkillBonuses SkillBonusesDefaultValue() => new(this);
[SerializableField(4, setter: "private")] [SerializableField(4, setter: "private")]
[SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster, canModify: true)]")] [SerializableFieldAttr("[CommandProperty(AccessLevel.GameMaster, canModify: true)]")]
private AosElementAttributes _resistances; private AosElementAttributes _resistances;
@ -56,6 +65,9 @@ namespace Server.Items
[SerializableFieldSaveFlag(4)] [SerializableFieldSaveFlag(4)]
private bool ShouldSerializeResistances() => !_resistances.IsEmpty; private bool ShouldSerializeResistances() => !_resistances.IsEmpty;
[SerializableFieldDefault(4)]
private AosElementAttributes ResistancesDefaultValue() => new(this);
[EncodedInt] [EncodedInt]
[InvalidateProperties] [InvalidateProperties]
[SerializableField(5)] [SerializableField(5)]