From 6265822463a80b56604dc02b62f8a3d9dbc04fb7 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Sat, 18 Jan 2025 15:03:37 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=8E=A8=E5=B8=81=E6=9C=BA=E5=A5=96?= =?UTF-8?q?=E6=B1=A0=E6=8A=BD=E5=A5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/action_pushcoin.go | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/worldsrv/action_pushcoin.go b/worldsrv/action_pushcoin.go index 08a4634..af10631 100644 --- a/worldsrv/action_pushcoin.go +++ b/worldsrv/action_pushcoin.go @@ -620,6 +620,11 @@ func PushCoinDraw(p *Player) { break } } + if has && index == int(curIndex) { + // 重复 + has = false + } + if !has { // 替换 if slices.Contains(PoolIndex, index) { @@ -633,12 +638,14 @@ func PushCoinDraw(p *Player) { }) p.WelfData.PushCoin.Turn[index] = e.GetId() } else { - p.WelfData.PushCoin.Turn[curIndex] = e1.GetId() - draw1 = append(draw1, &activity.DrawInfo{ - Id: curIndex, - ItemId: e1.GetItemId(), - ItemNum: e1.GetItemNum(), - }) + if !slices.Contains(PoolIndex, int(curIndex)) { + p.WelfData.PushCoin.Turn[curIndex] = e1.GetId() + draw1 = append(draw1, &activity.DrawInfo{ + Id: curIndex, + ItemId: e1.GetItemId(), + ItemNum: e1.GetItemNum(), + }) + } } p.WelfData.PushCoin.Next = int32(index) logger.Logger.Tracef("下次中普通奖品:index:%v ItemId:%v Num:%v", index, e.GetItemId(), e.GetItemNum())