diff --git a/worldsrv/action_phonelottery.go b/worldsrv/action_phonelottery.go index a67ab88..2b0bdf4 100644 --- a/worldsrv/action_phonelottery.go +++ b/worldsrv/action_phonelottery.go @@ -311,15 +311,14 @@ func (this *CSDiamondLotteryHandler) Process(s *netlib.Session, packetid int, da } p.AddDiamond(-diamondNum, 0, common.GainWayDiamondLottery, "sys", "钻石抽奖") pack := &player_proto.SCDiamondLottery{} - - weight := 0 - for _, lotteryInfo := range config.Info { - if lotteryInfo.Type == 1 { - weight += int(lotteryInfo.Oddrate) - } - } var items []*Item for i := 1; i <= int(count); i++ { + weight := 0 + for _, lotteryInfo := range config.Info { + if lotteryInfo.Type == 1 { + weight += int(lotteryInfo.Oddrate) + } + } random := rand.Intn(weight) + 1 value := 0 p.DiamondLotteryScore += 1