diff --git a/src/xml_parsing.cpp b/src/xml_parsing.cpp index 2181a0aca..62d0e4562 100644 --- a/src/xml_parsing.cpp +++ b/src/xml_parsing.cpp @@ -251,7 +251,7 @@ void VerifyXML(const std::string& xml_text, { const char* name = node->Name(); if (StrEqual(name, "Action") || StrEqual(name, "Decorator") || - StrEqual(name, "SubTree") || StrEqual(name, "Condition")) + StrEqual(name, "SubTree") || StrEqual(name, "Condition") || StrEqual(name, "Control")) { const char* ID = node->Attribute("ID"); if (!ID) @@ -309,6 +309,19 @@ void VerifyXML(const std::string& xml_text, "The node must have the attribute [ID]"); } } + else if (StrEqual(name, "Control")) + { + if (children_count == 0) + { + ThrowError(node->GetLineNum(), + "The node must have at least 1 child"); + } + if (!node->Attribute("ID")) + { + ThrowError(node->GetLineNum(), + "The node must have the attribute [ID]"); + } + } else if (StrEqual(name, "Sequence") || StrEqual(name, "SequenceStar") || StrEqual(name, "Fallback") ) @@ -443,7 +456,8 @@ TreeNode::Ptr XMLParser::Pimpl::createNodeFromXML(const XMLElement *element, std::string instance_name; // Actions and Decorators have their own ID - if (element_name == "Action" || element_name == "Decorator" || element_name == "Condition") + if (element_name == "Action" || element_name == "Decorator" || + element_name == "Condition" || element_name == "Control") { ID = element->Attribute("ID"); }