boss属性丢失,全部被限制属性不能超越,应该给ai和玩家施加不同的getinfo方法
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

道具扣除判断,因为判断扣完大于0,所以导致只剩一个的时候,道具成功使用但是不会扣除数量
This commit is contained in:
xinian
2026-04-15 14:44:46 +08:00
parent 5a7e20efec
commit 523d835ac0
3 changed files with 10 additions and 2 deletions

View File

@@ -61,7 +61,7 @@ func (s *ItemService) UPDATE(id uint32, count int) error {
if ok {
updateModel := s.dbm(s.Model).Where("item_id", id)
if count < 0 {
updateModel = updateModel.Where("item_cnt + ? > 0", count)
updateModel = updateModel.Where("item_cnt + ? >= 0", count)
}
result, err := updateModel.Increment("item_cnt", count)