Commit d71715f74e16ce94fa96d2d43af0e55ba0a104ab

Authored by Chris Davidson
1 parent 6d8e470c

Fix Reaver NPCs trying to attack before they're fully on the map via Command Staff

lol
... ... @@ -6196,9 +6196,11 @@ function _M:postUseTalent(ab, ret, silent)
6196 6196 -- Free melee blow
6197 6197 if ab.is_spell and ab.mode ~= "sustained" and self:knowTalent(self.T_CORRUPTED_STRENGTH) and not self:attr("forbid_corrupted_strength_blow") and not self.turn_procs.corrupted_strength then
6198 6198 local tgts = {}
6199   - for _, c in pairs(util.adjacentCoords(self.x, self.y)) do
6200   - local target = game.level.map(c[1], c[2], Map.ACTOR)
6201   - if target and self:reactionToward(target) < 0 then tgts[#tgts+1] = target end
  6199 + if game.level:hasEntity(self) and self.x and self.y then
  6200 + for _, c in pairs(util.adjacentCoords(self.x, self.y)) do
  6201 + local target = game.level.map(c[1], c[2], Map.ACTOR)
  6202 + if target and self:reactionToward(target) < 0 then tgts[#tgts+1] = target end
  6203 + end
6202 6204 end
6203 6205 if #tgts > 0 then
6204 6206 self.turn_procs.corrupted_strength = true
... ...