钻石抽奖权重计算修改
This commit is contained in:
parent
7e28a059ae
commit
84ffbd61c9
|
|
@ -313,13 +313,14 @@ func (this *CSDiamondLotteryHandler) Process(s *netlib.Session, packetid int, da
|
||||||
pack := &player_proto.SCDiamondLottery{}
|
pack := &player_proto.SCDiamondLottery{}
|
||||||
|
|
||||||
weight := 0
|
weight := 0
|
||||||
for _, lotteryInfo := range config.Info {
|
p.SnId = 102060301
|
||||||
if lotteryInfo.Type == 1 {
|
|
||||||
weight += int(lotteryInfo.Oddrate)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var items []*Item
|
var items []*Item
|
||||||
for i := 1; i <= int(count); i++ {
|
for i := 1; i <= int(count); i++ {
|
||||||
|
for _, lotteryInfo := range config.Info {
|
||||||
|
if lotteryInfo.Type == 1 {
|
||||||
|
weight += int(lotteryInfo.Oddrate)
|
||||||
|
}
|
||||||
|
}
|
||||||
random := rand.Intn(weight) + 1
|
random := rand.Intn(weight) + 1
|
||||||
value := 0
|
value := 0
|
||||||
p.DiamondLotteryScore += 1
|
p.DiamondLotteryScore += 1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue