diff --git a/src/actions/HeroAction.lua b/src/actions/HeroAction.lua index 0e2d0ce..e0a8070 100644 --- a/src/actions/HeroAction.lua +++ b/src/actions/HeroAction.lua @@ -202,8 +202,11 @@ function _M.talentRpc(agent, data) local cost = {} - if curLevel < #curData then - --if curLevel > #curData then return 2 end + if curLevel == #curData + 1 then + talent = talent:setv(0, curStage + 1) + talent = talent:setv(1, 1) + else + if curLevel > #curData then return 2 end local talentData = curData[curLevel] if not talentData then return 3 end @@ -214,13 +217,6 @@ 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