From a5f0d1d7da91652b5dfe3e837af1fd11031ecde4 Mon Sep 17 00:00:00 2001 From: Regalis Date: Sat, 7 Jan 2017 14:37:03 +0200 Subject: [PATCH] Fixed editable item properties not being saved if the property is also marked with a non-saveable HasDefaultValue attribute --- Subsurface/Source/Properties.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Subsurface/Source/Properties.cs b/Subsurface/Source/Properties.cs index 5e40813ff..a5aa106a2 100644 --- a/Subsurface/Source/Properties.cs +++ b/Subsurface/Source/Properties.cs @@ -258,14 +258,13 @@ namespace Barotrauma if (!saveIfDefault) { //only save - // - if the attribute is saveable - // - and it's different from the default value or can be changed in the editor + // - 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) continue; - - if (!attribute.defaultValue.Equals(value) || property.Attributes.OfType().Any()) + if ((!attribute.isSaveable && !attribute.defaultValue.Equals(value)) || + property.Attributes.OfType().Any()) { save = true; break;