diff --git a/src/actions/HeroAction.lua b/src/actions/HeroAction.lua index 358465b..0e2d0ce 100644 --- a/src/actions/HeroAction.lua +++ b/src/actions/HeroAction.lua @@ -202,11 +202,8 @@ function _M.talentRpc(agent, data) local cost = {} - if curLevel == #curData then - talent = talent:setv(0, curStage + 1) - talent = talent:setv(1, 1) - else - if curLevel > #curData then return 2 end + if curLevel < #curData then + --if curLevel > #curData then return 2 end local talentData = curData[curLevel] if not talentData then return 3 end @@ -217,6 +214,13 @@ function _M.talentRpc(agent, data) if not role:checkItemEnough(cost) then return 5 end if not role:costItems(cost, {log = {desc = "heroTalent", int1 = msg.id, int2 = hero:getProperty("type")}}) then return 6 end talent = talent:setv(1, curLevel + 1) + + if curLevel + 1 == #curData then + talent = talent:setv(0, curStage + 1) + talent = talent:setv(1, 1) + end + else + return 2 end curStage = talent:getv(0, 1) role:checkTaskEnter("HeroTalent", {heroType = hero:getProperty("type"), alv = curStage, count = 1}) -- libgit2 0.21.2