fix: Fixes issue with duping items and serialization, and sector lists. (#1662)
This commit is contained in:
parent
497ea87943
commit
3812a783ca
6 changed files with 32 additions and 53 deletions
|
|
@ -599,18 +599,16 @@ public class Item : IHued, IComparable<Item>, ISpawnable, IObjectPropertyListEnt
|
|||
|
||||
var oldParent = m_Parent;
|
||||
|
||||
if (m_Map != null && oldParent == null && value != null)
|
||||
{
|
||||
m_Map.OnLeave(this);
|
||||
}
|
||||
|
||||
m_Parent = value;
|
||||
|
||||
if (m_Map != null)
|
||||
if (m_Map != null && oldParent != null && value == null)
|
||||
{
|
||||
if (oldParent != null && m_Parent == null)
|
||||
{
|
||||
m_Map.OnEnter(this);
|
||||
}
|
||||
else if (m_Parent != null)
|
||||
{
|
||||
m_Map.OnLeave(this);
|
||||
}
|
||||
m_Map.OnEnter(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1207,9 +1205,13 @@ public class Item : IHued, IComparable<Item>, ISpawnable, IObjectPropertyListEnt
|
|||
{
|
||||
var old = m_Map;
|
||||
|
||||
if (m_Map != null && m_Parent == null)
|
||||
if (m_Map != null)
|
||||
{
|
||||
m_Map.OnLeave(this);
|
||||
if (m_Parent == null)
|
||||
{
|
||||
m_Map.OnLeave(this);
|
||||
}
|
||||
|
||||
SendRemovePacket();
|
||||
}
|
||||
|
||||
|
|
@ -3328,13 +3330,14 @@ public class Item : IHued, IComparable<Item>, ISpawnable, IObjectPropertyListEnt
|
|||
}
|
||||
}
|
||||
|
||||
private static readonly HashSet<string> _excludedProperties = new()
|
||||
{
|
||||
private static readonly HashSet<string> _excludedProperties =
|
||||
[
|
||||
"SaveBuffer",
|
||||
"Parent",
|
||||
"Next",
|
||||
"Previous",
|
||||
"OnLinkList"
|
||||
};
|
||||
];
|
||||
|
||||
public virtual bool DupeExcludedProperty(string propertyName) => _excludedProperties.Contains(propertyName);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue