Revert "七日签到奖励bug修复"

This reverts commit 53c573d7e0.
This commit is contained in:
hahwu 2026-03-12 20:05:40 +08:00
parent 6b2b215b68
commit 0bc16455e0

View File

@ -5,9 +5,7 @@ import (
"server/game/mod/item"
"server/gamedata"
"server/pkg/github.com/name5566/leaf/log"
"sort"
"strconv"
"time"
)
const (
@ -95,23 +93,10 @@ func GetSevenLoginJackpot(IsMonth int) []*gamedata.SevenLoginJackpotData {
}
func GetMonthActive(Id int) int {
month := int(time.Now().Month())
data, err := gamedata.GetData(CFG_SEVEN_LOGIN_MONTH)
active := []int{}
data, err := gamedata.GetDataByIntKey(CFG_SEVEN_LOGIN_MONTH, Id)
if err != nil {
log.Debug("GetSevenLoginReward err:%v", err)
return int(math.Inf(1))
}
for _, v := range data {
if gamedata.GetIntValue(v, "Month") == month {
active = append(active, gamedata.GetIntValue(v, "Active"))
}
}
sort.Ints(active)
if Id-1 < 0 || Id-1 >= len(active) {
log.Debug("GetSevenLoginReward err:%v", err)
return int(math.Inf(1))
}
id := active[Id-1]
return id
return gamedata.GetIntValue(data, "Active")
}