fix: Adds DupeExcludedProperty to Items (#1556)
This commit is contained in:
parent
85e23d8d83
commit
74f67487c4
2 changed files with 11 additions and 1 deletions
|
|
@ -3348,6 +3348,16 @@ public class Item : IHued, IComparable<Item>, ISpawnable, IObjectPropertyListEnt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static readonly HashSet<string> _excludedProperties = new()
|
||||||
|
{
|
||||||
|
"Parent",
|
||||||
|
"Next",
|
||||||
|
"Previous",
|
||||||
|
"OnLinkList"
|
||||||
|
};
|
||||||
|
|
||||||
|
public virtual bool DupeExcludedProperty(string propertyName) => _excludedProperties.Contains(propertyName);
|
||||||
|
|
||||||
public virtual void OnAfterDuped(Item newItem)
|
public virtual void OnAfterDuped(Item newItem)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ namespace Server.Commands
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Do not set the parent since it screws up mobile/container totals and weights.
|
// Do not set the parent since it screws up mobile/container totals and weights.
|
||||||
if (p.CanRead && p.CanWrite && p.Name != "Parent")
|
if (p.CanRead && p.CanWrite && !src.DupeExcludedProperty(p.Name) && !dest.DupeExcludedProperty(p.Name))
|
||||||
{
|
{
|
||||||
p.SetValue(dest, p.GetValue(src, null), null);
|
p.SetValue(dest, p.GetValue(src, null), null);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue