Skip to content

Commit

Permalink
fix: Ensure ShouldSerializeCrafter serializes when _crafter is not nu…
Browse files Browse the repository at this point in the history
…ll or empty (#2062)
  • Loading branch information
Senion31 authored Jan 13, 2025
1 parent 25431aa commit 863b4b5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Projects/UOContent/Items/Armor/BaseArmor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public abstract partial class BaseArmor : Item, IScissorable, IFactionItem, ICra
private string _crafter;

[SerializableFieldSaveFlag(10)]
private bool ShouldSerializeCrafter() => _crafter != null;
private bool ShouldSerializeCrafter() => !string.IsNullOrEmpty(_crafter);

[SerializableFieldSaveFlag(14)]
private bool ShouldSerializeResource() => _resource != DefaultResource;
Expand Down
2 changes: 1 addition & 1 deletion Projects/UOContent/Items/Clothing/BaseClothing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public abstract partial class BaseClothing
private string _crafter;

[SerializableFieldSaveFlag(8)]
private bool ShouldSerializeCrafter() => _crafter != null;
private bool ShouldSerializeCrafter() => !string.IsNullOrEmpty(_crafter);

[InvalidateProperties]
[SerializableField(9)]
Expand Down
2 changes: 1 addition & 1 deletion Projects/UOContent/Items/Quivers/BaseQuiver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public partial class BaseQuiver : Container, ICraftable, IAosItem
private string _crafter;

[SerializableFieldSaveFlag(4)]
private bool ShouldSerializeCrafter() => _crafter != null;
private bool ShouldSerializeCrafter() => !string.IsNullOrEmpty(_crafter);

[InvalidateProperties]
[SerializableField(5)]
Expand Down
2 changes: 1 addition & 1 deletion Projects/UOContent/Items/Weapons/BaseWeapon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public static void Configure()

[SerializableFieldSaveFlag(9)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private bool ShouldSerializeCrafter() => string.IsNullOrEmpty(_crafter);
private bool ShouldSerializeCrafter() => !string.IsNullOrEmpty(_crafter);

[InvalidateProperties]
[SerializableField(10)]
Expand Down

0 comments on commit 863b4b5

Please sign in to comment.