diff --git a/service/cardholder/logic.go b/service/cardholder/logic.go index 72a3489..32b1064 100644 --- a/service/cardholder/logic.go +++ b/service/cardholder/logic.go @@ -11,6 +11,7 @@ import ( "apigame/util/utstring" "apigame/util/zjson" "github.com/samber/lo" + "math" "sort" ) @@ -317,7 +318,7 @@ func GetStarCardList(player *Player, config *confcardholder.ActivityConfig, need } star := confCard.Star need := needStar - starAmount - needCardCount := need / star + needCardCount := int(math.Ceil(float64(need) / float64(star))) if cardCount-1 < needCardCount { needCardCount = cardCount - 1 } @@ -344,12 +345,12 @@ func GetStarCardList(player *Player, config *confcardholder.ActivityConfig, need } star := confCard.Star + 1 need := needStar - starAmount - needCardCount := need / star + needCardCount := int(math.Ceil(float64(need) / float64(star))) if cardCount-1 < needCardCount { needCardCount = cardCount - 1 } cardList[cardId] = needCardCount - starAmount += needCardCount * (star + 1) + starAmount += needCardCount * star } } if starAmount >= needStar { -- libgit2 0.21.0