diff --git a/src/adv/AdvMap.lua b/src/adv/AdvMap.lua index b47da76..9642c28 100644 --- a/src/adv/AdvMap.lua +++ b/src/adv/AdvMap.lua @@ -349,8 +349,8 @@ function Map:getDistance(froomId, fblockId, troomId, tblockId) local room1 = self.rooms[froomId] local room2 = self.rooms[troomId] if room1 and room2 then - local block1 = room1[fblockId] - local block2 = room2[tblockId] + local block1 = room1.blocks[fblockId] + local block2 = room2.blocks[tblockId] if block1 and block2 then local c1, r1 = room1:tranLtoG(block1.col, block1.row) local c2, r2 = room2:tranLtoG(block2.col, block2.row) diff --git a/src/adv/AdvPassive.lua b/src/adv/AdvPassive.lua index 742288d..886061e 100644 --- a/src/adv/AdvPassive.lua +++ b/src/adv/AdvPassive.lua @@ -50,7 +50,7 @@ end FilterFactory[Filter.RANGE] = function (_Filter) _Filter._execute = function (self, target, params) - if self.owner.blockId and self.owner.roomId and params.blockId and params.roomId then + if params and self.owner.blockId and self.owner.roomId and params.blockId and params.roomId then local distance = self.owner.battle.adv:getCurMap():getDistance(self.owner.roomId, self.owner.blockId, params.roomId, params.blockId) return distance ~= -1 and distance <= self.value end @@ -95,9 +95,8 @@ function Filter:execute(params) if not target then return end - if self:_execute(target) then - return self:_execute(target, params) - end + + return self:_execute(target, params) end -->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -- libgit2 0.21.2