Fix clone not copying parameter rules.

This commit is contained in:
Ottermandias 2024-01-16 21:32:10 +01:00
parent d57d40bd59
commit c245b30eaa
2 changed files with 7 additions and 6 deletions

View file

@ -22,7 +22,7 @@ public sealed class Design : DesignBase, ISavable
internal Design(Design other) internal Design(Design other)
: base(other) : base(other)
{ {
Tags = other.Tags.ToArray(); Tags = [.. other.Tags];
Description = other.Description; Description = other.Description;
AssociatedMods = new SortedList<Mod, ModSettings>(other.AssociatedMods); AssociatedMods = new SortedList<Mod, ModSettings>(other.AssociatedMods);
} }

View file

@ -40,11 +40,12 @@ public class DesignBase
internal DesignBase(DesignBase clone) internal DesignBase(DesignBase clone)
{ {
_designData = clone._designData; _designData = clone._designData;
CustomizeSet = clone.CustomizeSet; CustomizeSet = clone.CustomizeSet;
ApplyCustomize = clone.ApplyCustomizeRaw; ApplyCustomize = clone.ApplyCustomizeRaw;
ApplyEquip = clone.ApplyEquip & EquipFlagExtensions.All; ApplyEquip = clone.ApplyEquip & EquipFlagExtensions.All;
_designFlags = clone._designFlags & (DesignFlags)0x0F; ApplyParameters = clone.ApplyParameters & CustomizeParameterExtensions.All;
_designFlags = clone._designFlags & (DesignFlags)0x0F;
} }
/// <summary> Ensure that the customization set is updated when the design data changes. </summary> /// <summary> Ensure that the customization set is updated when the design data changes. </summary>