Skip to content

Commit

Permalink
fix: 修复Custom Action中途释放的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
dongwlin committed Oct 12, 2023
1 parent a623f76 commit ce41585
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions source/cli/CustomAction/CustomActionRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ void custom_action_init(CustomActionRegistrar& registrar)
registrar.add_action("QTE2", combat_QTE2);
}

void register_custom_action(MaaInstanceHandle maa_handle)
void register_custom_action(MaaInstanceHandle maa_handle, CustomActionRegistrar& registerar)
{
CustomActionRegistrar registerar;
custom_action_init(registerar);
registerar.register_actions(maa_handle);
}
3 changes: 2 additions & 1 deletion source/cli/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ int main(int argc, char** argv)
return -1;
}

register_custom_action(maa_handle);
CustomActionRegistrar registerar;
register_custom_action(maa_handle, registerar);

MaaTaskId task_id = 0;
for (const auto& task : tasks) {
Expand Down

0 comments on commit ce41585

Please sign in to comment.