fix: 修复购买道具数量上限校验逻辑
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed

This commit is contained in:
xinian
2026-03-27 16:53:07 +08:00
committed by cnb
parent ab31947c39
commit 6767075dcd
2 changed files with 43 additions and 12 deletions

View File

@@ -147,9 +147,12 @@ func (h Controller) BuyGoldItem(data *item.C2S_GOLD_BUY_PRODUCT, player *player.
player.Info.Coins -= int64(usegold)
case 1:
r := player.Service.Talk.Update(int(pro.ProductID), int(data.Count))
if !r {
return nil, errorcode.ErrorCodes.ErrGoldBeanSingleLimit
}
player.User.UpdateGold(player.Info.UserID, -int64(usegold))
//购买成功,执行记录
player.Service.Talk.Update(int(pro.ProductID), int(data.Count))
}