From 32fab5e0caa006d298ebdad92b44eb64b82e2e3a Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Fri, 10 May 2024 15:29:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=B8=B8=E6=88=8F=E6=8E=89=E8=90=BD?= =?UTF-8?q?=E9=81=93=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/DB_PropExchange.dat | 6 +++--- data/DB_Task.dat | Bin 2032 -> 2032 bytes srvdata/gamedropmgr.go | 22 +++++++++++++++++++--- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/data/DB_PropExchange.dat b/data/DB_PropExchange.dat index d7e877d..6a052b1 100644 --- a/data/DB_PropExchange.dat +++ b/data/DB_PropExchange.dat @@ -1,5 +1,5 @@ -6ֆ׆ӆԆՆ"= +6ӆԆՆֆ׆"= .؆نچۆ"= -WنچۆӆՆ׆؆Ԇֆ"  -]Նֆۆنچ܆ӆԆ׆؆" \ No newline at end of file +WӆԆ׆؆نچՆֆۆ"  +]ӆՆֆ׆؆نۆԆچ܆" \ No newline at end of file diff --git a/data/DB_Task.dat b/data/DB_Task.dat index 9046ecbfed9bdbbbd0d7be1e77657dbceb139186..d4832da16179fd8d908c97011cdd00b7b1ee938c 100644 GIT binary patch delta 198 zcmeys|ABvku_+tJl3q3e5i1Ukg+O{iFPj$=10$Cl2eSaP1fv482BQHZRPI6>vlT=& z|Hcen#>q>VL?(AK_6f3aEJ8BjK#T2W4W?|cw1G0mqB)EL91^SwtQs%afhM7j0b8G+6)u diff --git a/srvdata/gamedropmgr.go b/srvdata/gamedropmgr.go index 557d4a3..915270c 100644 --- a/srvdata/gamedropmgr.go +++ b/srvdata/gamedropmgr.go @@ -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 }