Merge remote-tracking branch 'upstream/master' into develop

This commit is contained in:
EvilFactory
2024-06-18 12:19:13 -03:00
263 changed files with 7788 additions and 2849 deletions
@@ -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);
}