fix: Fixes default GumpID and DropSound serialization for containers (#1631)

This commit is contained in:
Stefano Merotta 2023-12-09 01:02:23 +01:00 committed by GitHub
parent f35af0de2f
commit ca5aa80fcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -99,6 +99,9 @@ public partial class Container : Item
[SerializableFieldSaveFlag(1)] [SerializableFieldSaveFlag(1)]
private bool ShouldSerializeGumpId() => _gumpID != -1; private bool ShouldSerializeGumpId() => _gumpID != -1;
[SerializableFieldDefault(1)]
private int GumpIDDefaultValue() => -1;
[EncodedInt] [EncodedInt]
[SerializableProperty(2)] [SerializableProperty(2)]
[CommandProperty(AccessLevel.GameMaster)] [CommandProperty(AccessLevel.GameMaster)]
@ -115,6 +118,9 @@ public partial class Container : Item
[SerializableFieldSaveFlag(2)] [SerializableFieldSaveFlag(2)]
private bool ShouldSerializeDropSound() => _dropSound != -1; private bool ShouldSerializeDropSound() => _dropSound != -1;
[SerializableFieldDefault(2)]
private int DropSoundDefaultValue() => -1;
[CommandProperty(AccessLevel.GameMaster)] [CommandProperty(AccessLevel.GameMaster)]
public virtual int MaxWeight => Parent is Container { MaxWeight: 0 } ? 0 : DefaultMaxWeight; public virtual int MaxWeight => Parent is Container { MaxWeight: 0 } ? 0 : DefaultMaxWeight;