Skip to content

Commit

Permalink
Prevent monsters with no path from following us down stairs. Fix cont…
Browse files Browse the repository at this point in the history
…ributed by Uronym.
  • Loading branch information
kevingranade committed Mar 17, 2013
1 parent 87729d0 commit 00e5046
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions monmove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,10 @@ bool monster::will_reach(game *g, int x, int y)
if (has_flag(MF_IMMOBILE) && (posx != x || posy != y))
return false;

std::vector<point> path = g->m.route(posx, posy, x, y, has_flag(MF_BASHES));
if (path.size() == 0)
return false;

if (has_flag(MF_SMELLS) && g->scent(posx, posy) > 0 &&
g->scent(x, y) > g->scent(posx, posy))
return true;
Expand Down

0 comments on commit 00e5046

Please sign in to comment.