must support sorting so inheritance works properly (parent must be reloaded first)
| 2527 | struct GDScriptDepSort { |
| 2528 | //must support sorting so inheritance works properly (parent must be reloaded first) |
| 2529 | bool operator()(const Ref<GDScript> &A, const Ref<GDScript> &B) const { |
| 2530 | if (A == B) { |
| 2531 | return false; //shouldn't happen but.. |
| 2532 | } |
| 2533 | const GDScript *I = B->get_base().ptr(); |
| 2534 | while (I) { |
| 2535 | if (I == A.ptr()) { |
| 2536 | // A is a base of B |
| 2537 | return true; |
| 2538 | } |
| 2539 | |
| 2540 | I = I->get_base().ptr(); |
| 2541 | } |
| 2542 | |
| 2543 | return false; //not a base |
| 2544 | } |
| 2545 | }; |
| 2546 | |
| 2547 | void GDScriptLanguage::reload_all_scripts() { |