修复道具权重过滤
This commit is contained in:
parent
f3da9f9584
commit
15d8039a5b
@ -226,7 +226,13 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.PracticeReceiveR
|
||||
if len(pconfigure.Ants) > 0 { //额外道具加成
|
||||
ants2 = make([]*cfg.Gameatn, 0)
|
||||
r := rand.New(rand.NewSource(time.Now().Unix()))
|
||||
num := r.Int31n(pconfigure.Num[1]-pconfigure.Num[0]) + pconfigure.Num[0]
|
||||
num := int32(0)
|
||||
if len(pconfigure.Num) >= 2 && pconfigure.Num[1]-pconfigure.Num[0] > 0 {
|
||||
num = r.Int31n(pconfigure.Num[1]-pconfigure.Num[0]) + pconfigure.Num[0]
|
||||
} else {
|
||||
num = pconfigure.Num[0]
|
||||
}
|
||||
|
||||
if r.Int31n(100) < pconfigure.Probability { //随机一个道具
|
||||
total := 0
|
||||
for _, v := range pconfigure.Wget {
|
||||
|
Loading…
Reference in New Issue
Block a user