A couple of minor fixes

main
srikappa 5 years ago
parent 22d6e1ec0d
commit 889158e3a9

@ -283,7 +283,7 @@ namespace AzToolsFramework
{
if (!m_instanceEntityMapper->RegisterEntityToInstance(entityId, *this))
{
AZ_Error("Prefab", false,
AZ_Assert(false,
"Prefab - Failed to register entity with id %s with a Prefab Instance derived from source asset %s "
"This entity is likely already registered. Check for a double add.",
entityId.ToString().c_str(),

@ -119,10 +119,7 @@ namespace AzToolsFramework
newInstance->AddInstance(AZStd::move(instance));
}
/*
AzToolsFramework::EditorEntityContextRequestBus::Broadcast(
&AzToolsFramework::EditorEntityContextRequests::HandleEntitiesAdded, EntityList{containerEntity->GetId()});
*/
newInstance->SetTemplateSourcePath(filePath);
TemplateId newTemplateId = CreateTemplateFromInstance(*newInstance);
@ -162,14 +159,14 @@ namespace AzToolsFramework
void PrefabSystemComponent::UpdatePrefabTemplate(TemplateId templateId, const PrefabDom& updatedDom)
{
auto templateRef = FindTemplate(templateId);
if (templateRef.has_value())
auto templateToUpdate = FindTemplate(templateId);
if (templateToUpdate)
{
PrefabDom& templateDomToUpdate = templateRef->get().GetPrefabDom();
PrefabDom& templateDomToUpdate = templateToUpdate->get().GetPrefabDom();
if (AZ::JsonSerialization::Compare(templateDomToUpdate, updatedDom) != AZ::JsonSerializerCompareResult::Equal)
{
templateDomToUpdate.CopyFrom(updatedDom, templateDomToUpdate.GetAllocator());
templateRef->get().MarkAsDirty(true);
templateToUpdate->get().MarkAsDirty(true);
PropagateTemplateChanges(templateId);
}
}
@ -643,12 +640,9 @@ namespace AzToolsFramework
newLink.GetLinkDom().AddMember(rapidjson::StringRef(PrefabDomUtils::SourceName),
rapidjson::StringRef(sourceTemplate.GetFilePath().c_str()), newLink.GetLinkDom().GetAllocator());
PrefabDom linkPatchCopy;
linkPatchCopy.CopyFrom(linkPatch->get(), newLink.GetLinkDom().GetAllocator());
if (linkPatch && linkPatch->get().IsArray() && !(linkPatch->get().Empty()))
{
m_instanceToTemplatePropagator.AddPatchesToLink(linkPatchCopy, newLink);
m_instanceToTemplatePropagator.AddPatchesToLink(linkPatch.value(), newLink);
}
//update the target template dom to have the proper values for the source template dom

Loading…
Cancel
Save