Просмотр исходного кода

修复英雄成长功能测试

249435196@qq.com 1 год назад
Родитель
Сommit
bab0f0a469
2 измененных файлов с 15 добавлено и 10 удалено
  1. 11 9
      script/module/absAct/HeroGrowUp.lua
  2. 4 1
      script/module/role/RoleDBLogic.lua

+ 11 - 9
script/module/absAct/HeroGrowUp.lua

@@ -184,7 +184,7 @@ end
 function getTaskLeftTime(actStartTime, mainType)
 	local time = getTaskTime(mainType)
 	if not time then return end
-	local actLeftTime = getActLeftTime(actStartTime)
+	local actLeftTime = getActLeftTime()
 	return actLeftTime % time
 end
 
@@ -195,7 +195,7 @@ function isOpen(human)
     if openDay and openDay < absActConfig.openDay then
         return
     end
-	if not getActStartTime(human) then
+	if not getActStartTime() then
 		return
 	end
 	return true
@@ -381,7 +381,7 @@ function addJifen(human, value)
     end
 	local lvdefine = lvConfigs[1]
 	checkDB(human, actStartTime,groupID)
-	if not human.db.heroGrowUp then
+	if not next(human.db.heroGrowUp) then
 		initDB(human, actStartTime)
 	end
 	local heroGrowUpDB = human.db.heroGrowUp	
@@ -407,7 +407,7 @@ end
 
 -- 设置购买
 function setBuyKing(human, actStartTime)
-	if not human.db.heroGrowUp then
+	if not next(human.db.heroGrowUp) then
 		initDB(human, actStartTime)
 	end
 	local heroGrowUpDB = human.db.heroGrowUp
@@ -416,7 +416,8 @@ end
 
 -- 设置领奖
 function setGetReward(human,lv)
-	if not human.db.heroGrowUp then
+	local actStartTime = getActStartTime()
+	if not next(human.db.heroGrowUp) then
 		initDB(human, actStartTime)
 	end
 	local heroGrowUpDB = human.db.heroGrowUp
@@ -460,7 +461,8 @@ end
 
 -- 设置领奖
 function setGetExReward(human,lv)
-	if not human.db.heroGrowUp then
+	local actStartTime = getActStartTime()
+	if not next(human.db.heroGrowUp) then
 		initDB(human, actStartTime)
 	end
 	local heroGrowUpDB = human.db.heroGrowUp
@@ -484,7 +486,7 @@ end
 
 -- 设置已领取
 function setGetTask(human, actStartTime, id, cf)
-	if not human.db.heroGrowUp then
+	if not next(human.db.heroGrowUp)then
 		initDB(human, actStartTime)
 	end
 	local heroGrowUpDB = human.db.heroGrowUp	
@@ -525,7 +527,7 @@ end
 
 -- 更新进度
 function updateValue(human, actStartTime, mainType, taskType, key, value)
-	if not human.db.heroGrowUp then
+	if not next(human.db.heroGrowUp) then
 		initDB(human, actStartTime)
 	end
 	local heroGrowUpDB = human.db.heroGrowUp	
@@ -590,7 +592,7 @@ end
 -------------------------------------------- msg -------------------------------------------------------
 -- 封装基础信息
 function fontBaseNet(net, human, actStartTime, lvdefine)
-	net.leftTime = getActLeftTime(actStartTime)
+	net.leftTime = getActLeftTime()
 	net.lv = getLv(human)
 	net.jifen = getJifen(human)
 	net.maxJifen = lvdefine.needJifen

+ 4 - 1
script/module/role/RoleDBLogic.lua

@@ -421,8 +421,10 @@ function createDefaultRole(account)
 				unlock = 0,
 				upgradeFinish = {}
 			},
-		}
+		},
 		
+		heroGrowUp = {},
+
 		-- 注意 以后再加字段如初始化为非nil 要在下面的newAddDBData同步加,否则老号会报错。
 	}
 	db.createTime = os.time()
@@ -463,6 +465,7 @@ local newAddDBData = {
 			upgradeFinish = {}
 		},
 	},  -- 战令相关
+	heroGrowUp = {}, -- 英雄成长
 }
 local roleDBchanged
 local function handleNew(orgDB, newTable)