This commit is contained in:
aozhiwei 2024-04-15 16:59:13 +08:00
parent e21483a6a3
commit d8bcfe8104

View File

@ -10,6 +10,7 @@ import (
"net" "net"
"main/constant" "main/constant"
"main/common" "main/common"
"math/rand"
. "main/global" . "main/global"
) )
@ -372,4 +373,11 @@ func (this *playerMgr) GetRecommendPlayers(excludeHums map[string]int32, outHums
return true return true
}) })
} }
randLen := 0
if randLen < len(this.recommendHumans) {
randLen = len(this.recommendHumans)
}
rand.Shuffle(randLen, func (i int, j int) {
this.recommendHumans[i], this.recommendHumans[j] = this.recommendHumans[j], this.recommendHumans[i]
})
} }