Skip to content

Commit

Permalink
Fixed can be set in file logic, oops
Browse files Browse the repository at this point in the history
  • Loading branch information
vchelaru committed Jan 16, 2024
1 parent b972762 commit 0072383
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ private void HandleNamedObjectSelect(NamedObjectSave namedObject, GlueElement cu
// 1. I like the solution above to avoid confusion; but there are times when an object has properties which don't
// come from file - like the X/Y values of a TileMap. Therefore, some properties should have defaults that stick
// around. Eventually this probably means a new property on the VariableDefinition object.
// Update January 16, 2024 - added CanBeSetInFile. If false, then we won't null out the default value because
// there's no way this could be specified in a file so the default value is actually used.
var isFile = namedObject.SourceType == SourceType.File;

var ati = namedObject.GetAssetTypeInfo();
Expand All @@ -244,7 +246,7 @@ private void HandleNamedObjectSelect(NamedObjectSave namedObject, GlueElement cu
}
foreach(var variable in ati.VariableDefinitions)
{
if(variable.CanBeSetInFile == false)
if(variable.CanBeSetInFile)
{
variable.DefaultValue = null;
}
Expand Down

0 comments on commit 0072383

Please sign in to comment.