Merge branch 'develop' into audit
This commit is contained in:
commit
fdec4bd425
@ -300,3 +300,15 @@ func Rand6DigitNumber() string {
|
||||
n := rand.Intn(1000000)
|
||||
return fmt.Sprintf("%06d", n)
|
||||
}
|
||||
|
||||
func UniqueInts(input []int) []int {
|
||||
seen := make(map[int]struct{})
|
||||
result := make([]int, 0, len(input))
|
||||
for _, v := range input {
|
||||
if _, ok := seen[v]; !ok {
|
||||
seen[v] = struct{}{}
|
||||
result = append(result, v)
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
@ -3136,6 +3136,7 @@ func ReqPlayroomInfo(player *Player, buf []byte) error {
|
||||
RandList = append(RandList, v)
|
||||
}
|
||||
}
|
||||
RandList = GoUtil.UniqueInts(RandList)
|
||||
if len(RandList) == 0 {
|
||||
PlayroomMod.SetGameReward(0, 0, Star)
|
||||
} else if len(RandList) == 1 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user