From ac7fb4642ff11ebe40fefd21c14b82436d91ef9c Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Fri, 2 Dec 2022 11:13:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=AD=E4=B9=B0=E6=8C=91=E6=88=98=E5=8D=B7?= =?UTF-8?q?=E6=B6=88=E8=80=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hero/api_buy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hero/api_buy.go b/modules/hero/api_buy.go index dcd6e13e4..62f9009cb 100644 --- a/modules/hero/api_buy.go +++ b/modules/hero/api_buy.go @@ -72,7 +72,7 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.HeroBuyReq) (code pb return } - for i := record.Onebuy; i < req.BuyCount; i++ { + for i := totalCount - req.BuyCount; i < totalCount; i++ { if i >= int32(len(price)) { totalCost += float64(price[len(price)-1]) / 1000