Merge pull request #2459 from aws-lumberyard-dev/carlitosan/fix_entity_ref
fix entity reference removal when not in a variable
This commit is contained in:
@@ -137,16 +137,9 @@ namespace ScriptCanvasBuilder
|
||||
|
||||
if (!ScriptCanvas::Grammar::IsParserGeneratedId(entityId.first))
|
||||
{
|
||||
auto graphEntityId = variables.FindVariable(entityId.first);
|
||||
if (!graphEntityId)
|
||||
{
|
||||
AZ_Error("ScriptCanvasBuilder", false, "Missing EntityId from graph data that was just parsed");
|
||||
continue;
|
||||
}
|
||||
|
||||
// copy to override list for editor display
|
||||
if (graphEntityId->IsComponentProperty())
|
||||
if (auto graphEntityId = variables.FindVariable(entityId.first); graphEntityId && graphEntityId->IsComponentProperty())
|
||||
{
|
||||
// copy to override list for editor display
|
||||
m_overrides.push_back(*graphEntityId);
|
||||
auto& overrideValue = m_overrides.back();
|
||||
overrideValue.SetScriptInputControlVisibility(AZ::Edit::PropertyVisibility::Hide);
|
||||
|
||||
@@ -1943,7 +1943,8 @@ namespace ScriptCanvas
|
||||
{
|
||||
const auto requirement = ParseConstructionRequirement(variable);
|
||||
|
||||
if (requirement == Grammar::VariableConstructionRequirement::None || (requirement != Grammar::VariableConstructionRequirement::Static && !execution->IsStartCall()))
|
||||
if (requirement == Grammar::VariableConstructionRequirement::None
|
||||
|| requirement != Grammar::VariableConstructionRequirement::Static && execution != m_model.GetStart())
|
||||
{
|
||||
m_dotLua.WriteLineIndented("local %s = %s", variable->m_name.data(), ToValueString(variable->m_datum, m_configuration).data());
|
||||
}
|
||||
|
||||
+1047
File diff suppressed because it is too large
Load Diff
@@ -89,6 +89,11 @@ TEST_F(ScriptCanvasTestFixture, ProveError)
|
||||
EXPECT_TRUE(false);
|
||||
}
|
||||
|
||||
TEST_F(ScriptCanvasTestFixture, EntityIdInputForOnGraphStart)
|
||||
{
|
||||
RunUnitTestGraph("LY_SC_UnitTest_EntityIdInputForOnGraphStart");
|
||||
}
|
||||
|
||||
TEST_F(ScriptCanvasTestFixture, ParseErrorOnKnownNull)
|
||||
{
|
||||
ExpectParseError("LY_SC_UnitTest_ParseErrorOnKnownNull");
|
||||
|
||||
Reference in New Issue
Block a user