Fixed editable item properties not being saved if the property is also marked with a non-saveable HasDefaultValue attribute
This commit is contained in:
@@ -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<HasDefaultValue>())
|
||||
{
|
||||
if (!attribute.isSaveable) continue;
|
||||
|
||||
if (!attribute.defaultValue.Equals(value) || property.Attributes.OfType<Editable>().Any())
|
||||
if ((!attribute.isSaveable && !attribute.defaultValue.Equals(value)) ||
|
||||
property.Attributes.OfType<Editable>().Any())
|
||||
{
|
||||
save = true;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user