fix: 修复boss奖励发放逻辑
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-04-05 07:28:39 +08:00
committed by cnb
parent 6510e4e09b
commit 2ee0cbc094
4 changed files with 41 additions and 20 deletions

View File

@@ -102,7 +102,7 @@ func (p *Player) bossgive(taskID int, ot int) {
// 发放道具奖励(仅成功添加的道具才返回给前端)
for _, item := range gift.ItemList {
if success := p.ItemAdd(item.ItemId, item.ItemCnt); success {
res.ItemList = append(res.ItemList, item)
res.AddItemInfo(item)
}
}
@@ -112,5 +112,7 @@ func (p *Player) bossgive(taskID int, ot int) {
}
// 发送奖励通知给前端
p.SendPackCmd(8004, res)
if res.HasReward() {
p.SendPackCmd(8004, res)
}
}