Fixed crash when trying to blend to a nonexistent node

This commit is contained in:
viktorljung
2016-03-04 02:53:23 +01:00
parent 1ff91a5c5d
commit 1bd71931b8
+4 -1
View File
@@ -219,7 +219,6 @@ BlendTree::AutoBlendInfo BlendTree::AutoBlendStep(AutoBlendInfo blendInfo)
}
}
if(goalNodes.size() == 0) {
return blendInfo;
} else if(goalNodes.size() == 1) {
@@ -383,6 +382,10 @@ EntityWrapper BlendTree::GetSubTreeRoot(std::string nodeName)
{
std::vector<Node*> nodes = FindNodesByName(nodeName);
if (nodes.size() == 0) {
return EntityWrapper::Invalid;
}
std::vector<Node*> subTreeRoots;
for (auto it = nodes.begin(); it != nodes.end(); it++) {