From 9f882651eb385d6cb328ee857a00980c8076f23e Mon Sep 17 00:00:00 2001 From: kercylan98 Date: Thu, 26 Oct 2023 09:34:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20#58=20taskType=20?= =?UTF-8?q?=E5=8F=8A=E4=BA=8B=E4=BB=B6=E8=A2=AB=E9=81=97=E6=BC=8F=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/task/task.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/game/task/task.go b/game/task/task.go index 2130942..a0fbf55 100644 --- a/game/task/task.go +++ b/game/task/task.go @@ -10,6 +10,7 @@ import ( func NewTask(id int64, taskType int, condition int64, options ...Option) *Task { task := &Task{ id: id, + taskType: taskType, condition: condition, state: StateAccept, } @@ -181,11 +182,13 @@ func (slf *Task) SetChildCount(key any, count int64) { } slf.childCount[key] = count slf.refreshState() + OnRefreshTaskCount(slf.taskType, count) } // AddChildCount 增加子计数 func (slf *Task) AddChildCount(key any, count int64) { slf.SetChildCount(key, slf.childCount[key]+count) + OnRefreshTaskChildCount(slf.taskType, key, count) } // refreshState 刷新任务状态