Commit 77731057f25eaadc824fa04b0cbb5dbdd263b2a0
1 parent
262581b0
Fixes Stone Walking being usable when not adjacent to a wall
Showing
1 changed file
with
10 additions
and
3 deletions
... | ... | @@ -537,13 +537,20 @@ newTalent{ |
537 | 537 | return math.max(1, math.floor(self:combatScale(0.04*self:getCon() + self:getTalentLevel(t), 2.4, 1.4, 10, 9))) |
538 | 538 | end, |
539 | 539 | action = function(self, t) |
540 | - local tg = {type="bolt", range=self:getTalentRange(t), nolock=true, simple_dir_request=true, talent=t} | |
540 | + local tg = {type="bolt", range=self:getTalentRange(t), nolock=true, talent=t, simple_dir_request=true} | |
541 | 541 | local x, y = self:getTarget(tg) |
542 | 542 | if not x or not y then return nil end |
543 | 543 | local _ _, x, y = self:canProject(tg, x, y) |
544 | + | |
544 | 545 | local ox, oy = self.x, self.y |
545 | - self:probabilityTravel(x, y, t.getRange(self, t), function(tx, ty) return game.level.map(tx, ty, Map.ACTOR) and true or false end) | |
546 | - if ox == self.x and oy == self.y then return nil end | |
546 | + local l = line.new(self.x, self.y, x, y) | |
547 | + local nextx, nexty = l() | |
548 | + if not nextx or not game.level.map:checkEntity(nextx, nexty, Map.TERRAIN, "block_move", self) then return end | |
549 | + | |
550 | + self:probabilityTravel(x, y, t.getRange(self, t)) | |
551 | + | |
552 | + if ox == self.x and oy == self.y then return end | |
553 | + | |
547 | 554 | game:playSoundNear(self, "talents/earth") |
548 | 555 | return true |
549 | 556 | end, | ... | ... |
-
Please register or login to post a comment