diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-02 20:27:23 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-02 20:27:23 +0000 |
commit | 8459ae9cf2d41e728a359bb744c40616a04f2ff0 (patch) | |
tree | 42d6fef6982d1d6746e0e502894381685e43a8d2 | |
parent | 7d7691a8ba1924cc04f477978ecd771026a70cc0 (diff) | |
download | crawl-ref-8459ae9cf2d41e728a359bb744c40616a04f2ff0.tar.gz crawl-ref-8459ae9cf2d41e728a359bb744c40616a04f2ff0.zip |
Really fix pacified monsters' finding ways to blocked-off exits. As
part of this, put the random wandering around the target back in for
now.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6350 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/monstuff.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 04f39dbaa7..be3c2192bf 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -3098,7 +3098,7 @@ static void _handle_behaviour(monsters *mon) // wandering monsters at least appear to have some sort of // attention span. -- bwr if (mon->x == mon->target_x && mon->y == mon->target_y - || mons_is_batty(mon) || (!isPacified && one_chance_in(20))) + || mons_is_batty(mon) || one_chance_in(20)) { bool need_target = true; if (travelling) @@ -3158,7 +3158,7 @@ static void _handle_behaviour(monsters *mon) int erase = -1; // Erase how many waypoints? for (unsigned int i = mon->travel_path.size() - 1; - i >= 0; i--) + i >= 0; --i) { if (grid_see_grid(mon->x, mon->y, mon->travel_path[i].x, @@ -3319,7 +3319,10 @@ static void _handle_behaviour(monsters *mon) // the level can't reach its target, mark its target // as unreachable. if (isPacified) + { e[e_index].unreachable = true; + mon->travel_target = MTRAV_NONE; + } else { mon->target_x = 10 + random2(GXM - 10); |