From ff52882d5257dbae7602131ed4289de65ab64bbe Mon Sep 17 00:00:00 2001 From: zhouhaihai Date: Tue, 10 Dec 2019 15:20:26 +0800 Subject: [PATCH] 羁绊 --- src/models/RolePlugin.lua | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index d281341..c138bce 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -601,14 +601,14 @@ function RolePlugin.bind(Role) for _, id in pairs(heros or {}) do local hero = self.heros[id] if hero then - local job = csvdb["unitCsv"][hero:getProperty("type")].job - relations[job] = (relations[job] or 0) + 1 + local camp = csvdb["unitCsv"][hero:getProperty("type")].camp + relations[camp] = (relations[camp] or 0) + 1 end end if not next(relations) then return nil end - local curData = nil - for _, data in pairs(csvdb["unit_relationCsv"]) do + local curData = csvdb["unit_relationCsv"][0] + for _, data in ipairs(csvdb["unit_relationCsv"]) do local had = {} local isDone = true for _, count in pairs(data.relation:toArray(true, "=")) do @@ -636,9 +636,6 @@ function RolePlugin.bind(Role) function Role:getHeroActiveRelation(heros) local data = self:getHeroActiveRelationData(heros) local result = {} - if not data then - return result - end for attr, value in pairs(data.effect:toNumMap()) do result[AttsEnumEx[attr]] = (result[AttsEnumEx[attr]] or 0) + value end -- libgit2 0.21.2