fix: 修正任务状态判断与初始化逻辑
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-03-05 15:20:19 +08:00
committed by cnb
parent 2259093790
commit b80b017d33
2 changed files with 12 additions and 5 deletions

View File

@@ -25,7 +25,7 @@ func (p *Player) SptCompletedTask(taskID int, ot int) {
return
}
// 1. 检查任务当前状态:未接受才处理
if p.Info.GetTask(taskID) != model.Unaccepted {
if p.Info.GetTask(taskID) == model.Completed {
return
}
@@ -47,7 +47,7 @@ func (p *Player) TawerCompletedTask(taskID int, ot int) {
return
}
// 处理默认分支ot=-1仅奖励存在时才完成主任务
if p.Info.GetTask(taskID) == model.Unaccepted {
if p.Info.GetTask(taskID) != model.Completed {
defaultGift := p.getTaskGift(taskID, -1)
if defaultGift != nil { // 奖励存在才标记主任务完成
p.Info.SetTask(taskID, model.Completed)