Fixed crash when trying to blend to a nonexistent node
This commit is contained in:
@@ -219,7 +219,6 @@ BlendTree::AutoBlendInfo BlendTree::AutoBlendStep(AutoBlendInfo blendInfo)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(goalNodes.size() == 0) {
|
if(goalNodes.size() == 0) {
|
||||||
return blendInfo;
|
return blendInfo;
|
||||||
} else if(goalNodes.size() == 1) {
|
} else if(goalNodes.size() == 1) {
|
||||||
@@ -383,6 +382,10 @@ EntityWrapper BlendTree::GetSubTreeRoot(std::string nodeName)
|
|||||||
{
|
{
|
||||||
std::vector<Node*> nodes = FindNodesByName(nodeName);
|
std::vector<Node*> nodes = FindNodesByName(nodeName);
|
||||||
|
|
||||||
|
if (nodes.size() == 0) {
|
||||||
|
return EntityWrapper::Invalid;
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<Node*> subTreeRoots;
|
std::vector<Node*> subTreeRoots;
|
||||||
|
|
||||||
for (auto it = nodes.begin(); it != nodes.end(); it++) {
|
for (auto it = nodes.begin(); it != nodes.end(); it++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user