Merge remote-tracking branch 'upstream/master' into develop
This commit is contained in:
@@ -941,14 +941,16 @@ namespace Barotrauma.Items.Components
|
||||
#endif
|
||||
}
|
||||
|
||||
public virtual void Load(ContentXElement componentElement, bool usePrefabValues, IdRemap idRemap)
|
||||
public virtual void Load(ContentXElement componentElement, bool usePrefabValues, IdRemap idRemap, bool isItemSwap)
|
||||
{
|
||||
if (componentElement != null)
|
||||
{
|
||||
foreach (XAttribute attribute in componentElement.Attributes())
|
||||
{
|
||||
if (!SerializableProperties.TryGetValue(attribute.NameAsIdentifier(), out SerializableProperty property)) { continue; }
|
||||
if (property.OverridePrefabValues || !usePrefabValues)
|
||||
if (property.OverridePrefabValues ||
|
||||
!usePrefabValues ||
|
||||
(isItemSwap && property.GetAttribute<Editable>() is { TransferToSwappedItem: true }))
|
||||
{
|
||||
property.TrySetValue(this, attribute.Value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user