Commit e587a3aa156c991e329dbb096780ece528e4e985
1 parent
da743fbe
passive 距离生效bug
Showing
2 changed files
with
5 additions
and
6 deletions
Show diff stats
src/adv/AdvMap.lua
| ... | ... | @@ -349,8 +349,8 @@ function Map:getDistance(froomId, fblockId, troomId, tblockId) |
| 349 | 349 | local room1 = self.rooms[froomId] |
| 350 | 350 | local room2 = self.rooms[troomId] |
| 351 | 351 | if room1 and room2 then |
| 352 | - local block1 = room1[fblockId] | |
| 353 | - local block2 = room2[tblockId] | |
| 352 | + local block1 = room1.blocks[fblockId] | |
| 353 | + local block2 = room2.blocks[tblockId] | |
| 354 | 354 | if block1 and block2 then |
| 355 | 355 | local c1, r1 = room1:tranLtoG(block1.col, block1.row) |
| 356 | 356 | local c2, r2 = room2:tranLtoG(block2.col, block2.row) | ... | ... |
src/adv/AdvPassive.lua
| ... | ... | @@ -50,7 +50,7 @@ end |
| 50 | 50 | |
| 51 | 51 | FilterFactory[Filter.RANGE] = function (_Filter) |
| 52 | 52 | _Filter._execute = function (self, target, params) |
| 53 | - if self.owner.blockId and self.owner.roomId and params.blockId and params.roomId then | |
| 53 | + if params and self.owner.blockId and self.owner.roomId and params.blockId and params.roomId then | |
| 54 | 54 | local distance = self.owner.battle.adv:getCurMap():getDistance(self.owner.roomId, self.owner.blockId, params.roomId, params.blockId) |
| 55 | 55 | return distance ~= -1 and distance <= self.value |
| 56 | 56 | end |
| ... | ... | @@ -95,9 +95,8 @@ function Filter:execute(params) |
| 95 | 95 | if not target then |
| 96 | 96 | return |
| 97 | 97 | end |
| 98 | - if self:_execute(target) then | |
| 99 | - return self:_execute(target, params) | |
| 100 | - end | |
| 98 | + | |
| 99 | + return self:_execute(target, params) | |
| 101 | 100 | end |
| 102 | 101 | |
| 103 | 102 | -->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | ... | ... |