| 1928 | } |
| 1929 | |
| 1930 | Node *Node::get_node(const NodePath &p_path) const { |
| 1931 | Node *node = get_node_or_null(p_path); |
| 1932 | |
| 1933 | if (unlikely(!node)) { |
| 1934 | const String desc = get_description(); |
| 1935 | if (p_path.is_absolute()) { |
| 1936 | ERR_FAIL_V_MSG(nullptr, |
| 1937 | vformat(R"(Node not found: "%s" (absolute path attempted from "%s").)", p_path, desc)); |
| 1938 | } else { |
| 1939 | ERR_FAIL_V_MSG(nullptr, |
| 1940 | vformat(R"(Node not found: "%s" (relative to "%s").)", p_path, desc)); |
| 1941 | } |
| 1942 | } |
| 1943 | |
| 1944 | return node; |
| 1945 | } |
| 1946 | |
| 1947 | bool Node::has_node(const NodePath &p_path) const { |
| 1948 | return get_node_or_null(p_path) != nullptr; |