| 1387 | } |
| 1388 | |
| 1389 | void GDScript::_collect_dependencies(RBSet<GDScript *> &p_dependencies, const GDScript *p_except) { |
| 1390 | if (p_dependencies.has(this)) { |
| 1391 | return; |
| 1392 | } |
| 1393 | if (this != p_except) { |
| 1394 | p_dependencies.insert(this); |
| 1395 | } |
| 1396 | |
| 1397 | for (const KeyValue<StringName, GDScriptFunction *> &E : member_functions) { |
| 1398 | _collect_function_dependencies(E.value, p_dependencies, p_except); |
| 1399 | } |
| 1400 | |
| 1401 | if (implicit_initializer) { |
| 1402 | _collect_function_dependencies(implicit_initializer, p_dependencies, p_except); |
| 1403 | } |
| 1404 | |
| 1405 | if (implicit_ready) { |
| 1406 | _collect_function_dependencies(implicit_ready, p_dependencies, p_except); |
| 1407 | } |
| 1408 | |
| 1409 | if (static_initializer) { |
| 1410 | _collect_function_dependencies(static_initializer, p_dependencies, p_except); |
| 1411 | } |
| 1412 | |
| 1413 | for (KeyValue<StringName, Ref<GDScript>> &E : subclasses) { |
| 1414 | if (E.value != p_except) { |
| 1415 | E.value->_collect_dependencies(p_dependencies, p_except); |
| 1416 | } |
| 1417 | } |
| 1418 | |
| 1419 | for (const KeyValue<StringName, Variant> &E : constants) { |
| 1420 | GDScript *scr = _get_gdscript_from_variant(E.value); |
| 1421 | if (scr != nullptr && scr != p_except) { |
| 1422 | scr->_collect_dependencies(p_dependencies, p_except); |
| 1423 | } |
| 1424 | } |
| 1425 | } |
| 1426 | |
| 1427 | GDScript::GDScript() : |
| 1428 | script_list(this) { |
no test coverage detected