Skip to content

Commit d86eee5

Browse files
committed
在接口处添加注释
1 parent 08e8089 commit d86eee5

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

custom_action.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ type CustomActionArg struct {
3939
CurrentTaskName string
4040
CustomActionName string
4141
CustomActionParam string
42+
// RecognitionDetail may be nil when the custom action runs on an action-only
43+
// node (e.g. invoked via Context.RunAction), where reco_id is invalid.
4244
RecognitionDetail *RecognitionDetail
4345
Box Rect
4446
}
@@ -78,10 +80,7 @@ func _MaaCustomActionCallbackAgent(
7880

7981
ctx := &Context{handle: context}
8082
tasker := ctx.GetTasker()
81-
// recoId is invalid (0) when the custom action runs on an action-only node
82-
// (e.g. invoked via Context.RunAction). Querying recognition detail with an
83-
// invalid id makes the framework log a spurious error, so skip it and leave
84-
// RecognitionDetail nil in that case.
83+
// Skip GetRecognitionDetail for invalid recoId to avoid a spurious framework error log.
8584
var recognitionDetail *RecognitionDetail
8685
if recoId != 0 {
8786
var err error

0 commit comments

Comments
 (0)