@@ -278,6 +278,13 @@ const std::set<std::string>& BehaviorTreeFactory::builtinNodes() const
278
278
Tree BehaviorTreeFactory::createTreeFromText (const std::string& text,
279
279
Blackboard::Ptr blackboard)
280
280
{
281
+ if (!parser_->registeredBehaviorTrees ().empty ()) {
282
+ std::cout << " WARNING: You executed BehaviorTreeFactory::createTreeFromText "
283
+ " after registerBehaviorTreeFrom[File/Text].\n "
284
+ " This is NOTm probably, what you want to do.\n "
285
+ " You should probably use BehaviorTreeFactory::createTree, instead"
286
+ << std::endl;
287
+ }
281
288
XMLParser parser (*this );
282
289
parser.loadFromText (text);
283
290
auto tree = parser.instantiateTree (blackboard);
@@ -288,6 +295,14 @@ Tree BehaviorTreeFactory::createTreeFromText(const std::string& text,
288
295
Tree BehaviorTreeFactory::createTreeFromFile (const std::string& file_path,
289
296
Blackboard::Ptr blackboard)
290
297
{
298
+ if (!parser_->registeredBehaviorTrees ().empty ()) {
299
+ std::cout << " WARNING: You executed BehaviorTreeFactory::createTreeFromFile "
300
+ " after registerBehaviorTreeFrom[File/Text].\n "
301
+ " This is NOTm probably, what you want to do.\n "
302
+ " You should probably use BehaviorTreeFactory::createTree, instead"
303
+ << std::endl;
304
+ }
305
+
291
306
XMLParser parser (*this );
292
307
parser.loadFromFile (file_path);
293
308
auto tree = parser.instantiateTree (blackboard);
0 commit comments