bug修复

This commit is contained in:
hahwu 2025-06-11 15:25:47 +08:00
parent 7bd781f032
commit 6722304746
2 changed files with 6 additions and 10 deletions

View File

@ -53,17 +53,12 @@ func GetOrderNByLv(lv int) (int, error) {
// 获取升级经验 // 获取升级经验
func GetLevUpExp(lv int) (int, int) { func GetLevUpExp(lv int) (int, int) {
Exp := 0 data, err := gamedata.GetDataByIntKey(CFG_NAME, lv)
PExp := 0 if err != nil {
for i := 1; i <= lv; i++ { log.Debug("UserDataCfg GetLevUpExp lv:%v not found", lv)
data, err := gamedata.GetDataByIntKey(CFG_NAME, i) return 0, 0
if err != nil {
continue
}
Exp += gamedata.GetIntValue(data, "Exp")
PExp += gamedata.GetIntValue(data, "PExp")
} }
return Exp, PExp return gamedata.GetIntValue(data, "Exp"), gamedata.GetIntValue(data, "PExp")
} }
// 获取能量回复时间 // 获取能量回复时间

View File

@ -497,6 +497,7 @@ func (p *PlayerBaseData) AddExp(player *Player, exp int, pexp int) (int, error)
Num++ Num++
BaseMod.Level++ BaseMod.Level++
BaseMod.Exp -= upExp BaseMod.Exp -= upExp
BaseMod.PExp -= upPExp
upExp, upPExp = userCfg.GetLevUpExp(BaseMod.Level) upExp, upPExp = userCfg.GetLevUpExp(BaseMod.Level)
// 日常任务解锁 // 日常任务解锁
DailyTaskMod := player.PlayMod.getDailyTaskMod() DailyTaskMod := player.PlayMod.getDailyTaskMod()