```
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

fix(item): 修复物品数量判断逻辑

- 将物品数量判断从 `!= 0` 改为 `> 0`,确保只有正数才添加到列表中
- 将物品检查逻辑从 `< 1` 改为 `<= 0`,确保正确处理边界情况
- 在物品更新方法中增加ID为0的防护,避免无效操作
```
This commit is contained in:
昔念
2026-02-22 19:33:17 +08:00
parent 1dc75b529d
commit 3e4b091724
5 changed files with 25 additions and 2 deletions

View File

@@ -32,7 +32,7 @@ func (h Controller) GetUserItemList(data *item.ItemListInboundInfo, c *player.Pl
ItemCnt: uint32(itemData.ItemCnt),
LeftTime: ItemDefaultLeftTime,
}
if itemInfo.ItemCnt != 0 {
if itemInfo.ItemCnt > 0 {
result.ItemList = append(result.ItemList, itemInfo)
}
}