diff --git a/Subsurface/Source/Properties.cs b/Subsurface/Source/Properties.cs index f4d036ddb..42ee6c224 100644 --- a/Subsurface/Source/Properties.cs +++ b/Subsurface/Source/Properties.cs @@ -255,18 +255,22 @@ namespace Barotrauma object value = property.GetValue(); if (value == null) continue; - //only save if the value has been changed from the default value and the attribute is saveable - bool dontSave = true; + //only save + // - if the attribute is saveable + // - and it's different from the default value or can be changed in the editor + bool save = false; foreach (var attribute in property.Attributes.OfType()) { - if (attribute.isSaveable && !attribute.defaultValue.Equals(value)) + if (!attribute.isSaveable) continue; + + if (!attribute.defaultValue.Equals(value) || property.Attributes.OfType().Any()) { - dontSave = false; + save = true; break; } } - if (dontSave) continue; + if (!save) continue; string stringValue; if (value is float)