Commit ff52882d5257dbae7602131ed4289de65ab64bbe

Authored by zhouhaihai
1 parent a8f91e83

羁绊

Showing 1 changed file with 4 additions and 7 deletions   Show diff stats
src/models/RolePlugin.lua
@@ -601,14 +601,14 @@ function RolePlugin.bind(Role) @@ -601,14 +601,14 @@ function RolePlugin.bind(Role)
601 for _, id in pairs(heros or {}) do 601 for _, id in pairs(heros or {}) do
602 local hero = self.heros[id] 602 local hero = self.heros[id]
603 if hero then 603 if hero then
604 - local job = csvdb["unitCsv"][hero:getProperty("type")].job  
605 - relations[job] = (relations[job] or 0) + 1 604 + local camp = csvdb["unitCsv"][hero:getProperty("type")].camp
  605 + relations[camp] = (relations[camp] or 0) + 1
606 end 606 end
607 end 607 end
608 if not next(relations) then return nil end 608 if not next(relations) then return nil end
609 609
610 - local curData = nil  
611 - for _, data in pairs(csvdb["unit_relationCsv"]) do 610 + local curData = csvdb["unit_relationCsv"][0]
  611 + for _, data in ipairs(csvdb["unit_relationCsv"]) do
612 local had = {} 612 local had = {}
613 local isDone = true 613 local isDone = true
614 for _, count in pairs(data.relation:toArray(true, "=")) do 614 for _, count in pairs(data.relation:toArray(true, "=")) do
@@ -636,9 +636,6 @@ function RolePlugin.bind(Role) @@ -636,9 +636,6 @@ function RolePlugin.bind(Role)
636 function Role:getHeroActiveRelation(heros) 636 function Role:getHeroActiveRelation(heros)
637 local data = self:getHeroActiveRelationData(heros) 637 local data = self:getHeroActiveRelationData(heros)
638 local result = {} 638 local result = {}
639 - if not data then  
640 - return result  
641 - end  
642 for attr, value in pairs(data.effect:toNumMap()) do 639 for attr, value in pairs(data.effect:toNumMap()) do
643 result[AttsEnumEx[attr]] = (result[AttsEnumEx[attr]] or 0) + value 640 result[AttsEnumEx[attr]] = (result[AttsEnumEx[attr]] or 0) + value
644 end 641 end