Procházet zdrojové kódy

修改符文重铸问题

gitxsm před 3 týdny
rodič
revize
ebf358779b
1 změnil soubory, kde provedl 12 přidání a 12 odebrání
  1. 12 12
      script/module/fuwen/FuwenLogic.lua

+ 12 - 12
script/module/fuwen/FuwenLogic.lua

@@ -1109,23 +1109,23 @@ function fuwenRefreshSave(human,fuwenID,fuwenIndex,pos,heroID,heroIndex)
             Log.write(Log.LOGID_DEBUG, human.db._id, human.db.newUniqueTag, human.db.name, human.db.lv, fuwen.id,"refreshsave attrTemp is empty")
         end
         if fuwen.skillTemp and next(fuwen.skillTemp) then
+            local oldSkillLockList = fuwen.skillLockList
             fuwen.skill = fuwen.skillTemp
             fuwen.skillTemp = nil
 
-            local skillLockList = fuwen.skillLockList
-            if skillLockList and next(skillLockList) then
-                -- local posList = {}
-                -- for _,skillPos in pairs(skillLockList) do
-                --     posList[skillPos] = 1
-                -- end
-
-                skillLockList = {}
+            -- 按 skillId 保留原锁定状态,并更新为新技能列表中的位置(兼容线上已有 skillLockList)
+            if oldSkillLockList and next(oldSkillLockList) then
+                local newSkillLockList = {}
                 for skillPos, skillId in ipairs(fuwen.skill) do
-                    -- if posList[skillPos] then
-                        skillLockList[skillId] = skillPos
-                    -- end
+                    if oldSkillLockList[skillId] then
+                        newSkillLockList[skillId] = skillPos
+                    end
+                end
+                if next(newSkillLockList) then
+                    fuwen.skillLockList = newSkillLockList
+                else
+                    fuwen.skillLockList = nil
                 end
-                fuwen.skillLockList = skillLockList
             end
         else
             --Log.write(Log.LOGID_DEBUG, human.db._id, human.db.account, human.db.name, human.db.lv, fuwen.id,"refreshsave skillTemp is empty")