Skip to content

Commit

Permalink
fix: Fixes weapon and armor quality default value (#1710)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamronbatman authored Mar 28, 2024
1 parent f3d1fb8 commit 70575e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Projects/UOContent/Items/Armor/BaseArmor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ public abstract partial class BaseArmor : Item, IScissorable, IFactionItem, ICra
[SerializableFieldSaveFlag(10)]
private bool ShouldSerializeCrafter() => _crafter != null;

// Field 11
private ArmorQuality _quality = ArmorQuality.Regular;

[SerializableFieldSaveFlag(14)]
private bool ShouldSerializeResource() => _resource != DefaultResource;

Expand Down Expand Up @@ -155,6 +152,7 @@ public BaseArmor(int itemID) : base(itemID)
{
_crafter = null;

_quality = ArmorQuality.Regular;
_resource = DefaultResource;
Hue = CraftResources.GetHue(_resource);

Expand Down Expand Up @@ -193,7 +191,7 @@ public BaseArmor(int itemID) : base(itemID)
public virtual int OldDexReq => 0;
public virtual int OldIntReq => 0;

[SerializableProperty(11, useField: nameof(_quality))]
[SerializableProperty(11)]
[CommandProperty(AccessLevel.GameMaster)]
public ArmorQuality Quality
{
Expand All @@ -209,6 +207,9 @@ public ArmorQuality Quality
[SerializableFieldSaveFlag(11)]
private bool ShouldSerializeArmorQuality() => _quality != ArmorQuality.Regular;

[SerializableFieldDefault(11)]
private ArmorQuality QualityDefaultValue() => ArmorQuality.Regular;

[SerializableProperty(12)]
[CommandProperty(AccessLevel.GameMaster)]
public ArmorDurabilityLevel Durability
Expand Down
3 changes: 3 additions & 0 deletions Projects/UOContent/Items/Weapons/BaseWeapon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,9 @@ public WeaponQuality Quality
[SerializableFieldSaveFlag(3)]
private bool ShouldSerializeQuality() => _quality != WeaponQuality.Regular;

[SerializableFieldDefault(3)]
private WeaponQuality QualityDefaultValue() => WeaponQuality.Regular;

[SerializableProperty(4)]
[CommandProperty(AccessLevel.GameMaster)]
public int HitPoints
Expand Down

0 comments on commit 70575e1

Please sign in to comment.