bug修复

This commit is contained in:
hahwu 2025-06-11 14:54:20 +08:00
parent 43a27e9eba
commit 7bd781f032

View File

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