| 784 | } |
| 785 | |
| 786 | IDrawableModule* IDrawableModule::FindChild(const std::string name, bool fail) const |
| 787 | { |
| 788 | if (name.empty()) |
| 789 | return nullptr; |
| 790 | for (int i = 0; i < mChildren.size(); ++i) |
| 791 | { |
| 792 | if (strcmp(mChildren[i]->Name(), name.c_str()) == 0) |
| 793 | return mChildren[i]; |
| 794 | } |
| 795 | if (mTypeName == "effectchain") // Due to an issue in the past where child modules of the effectchain module weren't saving their names correctly we are going to try and fix the loading here. |
| 796 | { |
| 797 | auto child = FindChild(name.substr(0, name.length() - 1), false); |
| 798 | if (child) |
| 799 | return child; |
| 800 | } |
| 801 | if (fail) |
| 802 | throw UnknownModuleException(name); |
| 803 | return nullptr; |
| 804 | } |
| 805 | |
| 806 | void IDrawableModule::AddChild(IDrawableModule* child) |
| 807 | { |
no test coverage detected