| 459 | } |
| 460 | |
| 461 | bool Core::addScriptPath(std::filesystem::path path, bool search_before) |
| 462 | { |
| 463 | std::lock_guard<std::mutex> lock(script_path_mutex); |
| 464 | auto &vec = script_paths[search_before ? 0 : 1]; |
| 465 | if (std::find(vec.begin(), vec.end(), path) != vec.end()) |
| 466 | return false; |
| 467 | if (!Filesystem::isdir(path)) |
| 468 | return false; |
| 469 | vec.push_back(path); |
| 470 | return true; |
| 471 | } |
| 472 | |
| 473 | bool Core::setModScriptPaths(const std::vector<std::filesystem::path> &mod_script_paths) { |
| 474 | std::lock_guard<std::mutex> lock(script_path_mutex); |
no test coverage detected