Explorar el Código

修改角色升级bug

gitxsm hace 1 año
padre
commit
21d6cea509
Se han modificado 1 ficheros con 4 adiciones y 3 borrados
  1. 4 3
      script/core/ObjHuman.lua

+ 4 - 3
script/core/ObjHuman.lua

@@ -349,18 +349,19 @@ function getHeroAttrs(human, bagIndex)
 end
 
 function checkLevelUp(human)
-	if human.db.lv > #RoleExcel.exp then
+	local maxLevel = #RoleExcel.exp
+	if human.db.lv > maxLevel then
 		return 0
 	end
 
 	local levelUp = 0
 	while human.db.exp > 0 do
         local needExp = 0
-        if human.db.lv < 200 then
+        if human.db.lv < maxLevel then
 		    needExp = RoleExcel.exp[human.db.lv + 1].exp
 		end
         if needExp <= human.db.exp then
-		    if human.db.lv >= #RoleExcel.exp then
+		    if human.db.lv >= maxLevel then
 			    if human.db.exp > needExp then
 			        human.db.exp = needExp
 			    end