Fixed a brainfart in property saving (i.e. saveable but non-editable properties not being saved)
This commit is contained in:
@@ -259,11 +259,11 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
//only save
|
//only save
|
||||||
// - if the attribute is saveable and it's different from the default value
|
// - if the attribute is saveable and it's different from the default value
|
||||||
// - or can be changed in the editor
|
// - or can be changed in-game or in the editor
|
||||||
bool save = false;
|
bool save = false;
|
||||||
foreach (var attribute in property.Attributes.OfType<HasDefaultValue>())
|
foreach (var attribute in property.Attributes.OfType<HasDefaultValue>())
|
||||||
{
|
{
|
||||||
if ((!attribute.isSaveable && !attribute.defaultValue.Equals(value)) ||
|
if ((attribute.isSaveable && !attribute.defaultValue.Equals(value)) ||
|
||||||
property.Attributes.OfType<Editable>().Any())
|
property.Attributes.OfType<Editable>().Any())
|
||||||
{
|
{
|
||||||
save = true;
|
save = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user