fix: Ensure ShouldSerializeCrafter serializes when _crafter is not null or empty (#2062)

This commit is contained in:
Nathan Oines 2025-01-13 15:22:56 -06:00 committed by GitHub
parent 25431aa7f5
commit 863b4b5460
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 4 additions and 4 deletions

View file

@ -101,7 +101,7 @@ namespace Server.Items
private string _crafter;
[SerializableFieldSaveFlag(10)]
private bool ShouldSerializeCrafter() => _crafter != null;
private bool ShouldSerializeCrafter() => !string.IsNullOrEmpty(_crafter);
[SerializableFieldSaveFlag(14)]
private bool ShouldSerializeResource() => _resource != DefaultResource;

View file

@ -95,7 +95,7 @@ namespace Server.Items
private string _crafter;
[SerializableFieldSaveFlag(8)]
private bool ShouldSerializeCrafter() => _crafter != null;
private bool ShouldSerializeCrafter() => !string.IsNullOrEmpty(_crafter);
[InvalidateProperties]
[SerializableField(9)]

View file

@ -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)]

View file

@ -104,7 +104,7 @@ public abstract partial class BaseWeapon : Item, IWeapon, IFactionItem, ICraftab
[SerializableFieldSaveFlag(9)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private bool ShouldSerializeCrafter() => string.IsNullOrEmpty(_crafter);
private bool ShouldSerializeCrafter() => !string.IsNullOrEmpty(_crafter);
[InvalidateProperties]
[SerializableField(10)]