v1.5.7.0 (Summer Update)

This commit is contained in:
Regalis11
2024-06-18 16:49:51 +03:00
parent 4a63dacbce
commit 230d1b6e78
263 changed files with 7792 additions and 2845 deletions
@@ -939,14 +939,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);
}