From ff739c430e28a43d3c058be81b8d4c512a403792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E5=BF=B5?= <12574910+72wo@users.noreply.github.com> Date: Sat, 21 Feb 2026 00:41:49 +0800 Subject: [PATCH] =?UTF-8?q?```=20fix(config):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=89=A9=E5=93=81=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在GetEgg方法中修正了物品数量计算的位置,将数据添加操作移至条件判断内部, 确保只有当ItemMaxCount不为0时才将物品信息添加到结果数组中。 ``` --- modules/config/service/item.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/config/service/item.go b/modules/config/service/item.go index 21b6a7ba..afe29f79 100644 --- a/modules/config/service/item.go +++ b/modules/config/service/item.go @@ -48,9 +48,8 @@ func (s *ItemService) GetEgg(count int64) []data.ItemInfo { for _, v := range rr { if v.ItemMaxCount != 0 { v.ItemMinCount = int64(grand.N(int(v.ItemMinCount), int(v.ItemMaxCount))) - + res = append(res, data.ItemInfo{ItemId: v.ItemID, ItemCnt: v.ItemMinCount}) } - res = append(res, data.ItemInfo{ItemId: v.ItemID, ItemCnt: v.ItemMinCount}) }