fix:游戏掉落道具

This commit is contained in:
sk 2024-05-10 15:29:09 +08:00
parent 65258fe07e
commit 32fab5e0ca
3 changed files with 22 additions and 6 deletions

View File

@ -1,5 +1,5 @@
6ж├в├с├т├у├"║█ю└=
6с├т├уж├в"║█ю└=
.؆Ù†Ú†Û†"¡<>À„=
Wы├з├ш├с├у├в├ь├т├ж" ║█─╜Б
]у├ж├ш├ы├з├э├с├т├в├ь"╒█Т
Wс├т├в├ь├ы├з├у├ж├ш" ║█─╜Б
]с├у├ж├в├ь├ы├ш├т├з├э"╒█Т

Binary file not shown.

View File

@ -76,9 +76,9 @@ func (this *GameDropMgr) GetDropInfoByBaseScore(gameId, baseCoin int32) []*GameD
i := sort.Search(len(arr), func(i int) bool {
return arr[i].BaseCoin > int64(baseCoin)
})
if i < len(arr) && i > 0 {
n := arr[i-1].BaseCoin
for i := i - 1; i >= 0; i-- {
f := func(n int64, i int) {
for ; i >= 0; i-- {
if arr[i].BaseCoin == n {
ret = append(ret, arr[i])
} else {
@ -86,5 +86,21 @@ func (this *GameDropMgr) GetDropInfoByBaseScore(gameId, baseCoin int32) []*GameD
}
}
}
// 找到
if i < len(arr) && i > 0 {
n := arr[i-1].BaseCoin
f(n, i-1)
}
if len(ret) == 0 {
// 没找到,最大底注是否可用
i = len(arr) - 1
n := arr[i].BaseCoin
if n <= int64(baseCoin) {
f(n, i)
}
}
return ret
}