Commit 871b3da349d79d1a3f1cedc5ccced8849c9abe66

Authored by zhouhaihai
1 parent c23734ee

被动 取消

Showing 2 changed files with 7 additions and 3 deletions   Show diff stats
src/adv/AdvPassive.lua
@@ -304,7 +304,8 @@ function Passive:canEffect(effType, effValue) @@ -304,7 +304,8 @@ function Passive:canEffect(effType, effValue)
304 end 304 end
305 --禁用被动技 305 --禁用被动技
306 local count = self.owner:getDisablePassiveCount() 306 local count = self.owner:getDisablePassiveCount()
307 - if count and (count == 0 or self.owner:getPassiveIdx(self) <= count) then 307 + local idx = self.owner:getPassiveIdx(self)
  308 + if count and idx and (count == 0 or idx <= count) then
308 return 309 return
309 end 310 end
310 return true 311 return true
src/adv/AdvPlayer.lua
@@ -115,10 +115,13 @@ end @@ -115,10 +115,13 @@ end
115 function BaseObject:getPassiveIdx(passive) 115 function BaseObject:getPassiveIdx(passive)
116 for idx, passive_ in ipairs(self.passives) do 116 for idx, passive_ in ipairs(self.passives) do
117 if passive_ == passive then 117 if passive_ == passive then
118 - return idx 118 + if passive.passiveData.dispel ~= 1 then
  119 + return idx
  120 + end
  121 + return
119 end 122 end
120 end 123 end
121 - return 999 124 + return
122 end 125 end
123 126
124 function BaseObject:getDisablePassiveCount() 127 function BaseObject:getDisablePassiveCount()