mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-17 18:01:26 +08:00
feat: CustomTask增加任务存在检测
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
#include "CustomTask.h"
|
||||
|
||||
#include "Config/TaskData.h"
|
||||
#include "Task/Miscellaneous/ScreenshotTaskPlugin.h"
|
||||
#include "Task/ProcessTask.h"
|
||||
|
||||
#include "Utils/Logger.hpp"
|
||||
|
||||
asst::CustomTask::CustomTask(const AsstCallback& callback, Assistant* inst) :
|
||||
@@ -28,6 +29,10 @@ bool asst::CustomTask::set_params(const json::value& params)
|
||||
Log.error("set_params failed, task is not string");
|
||||
return false;
|
||||
}
|
||||
if (Task.get(t.as_string()) == nullptr) {
|
||||
Log.error("set_params failed, task not found: ", t.as_string());
|
||||
return false;
|
||||
}
|
||||
tasks.emplace_back(t.as_string());
|
||||
}
|
||||
m_custom_task_ptr->set_tasks(std::move(tasks));
|
||||
|
||||
Reference in New Issue
Block a user