diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-29 02:19:37 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-29 02:19:37 +0000 |
commit | 2739849714d0e5356dedc5b6ba8d7eb8620d0d37 (patch) | |
tree | d4b6bd94cfd3ef9bb043de33bd7a9c1221123a3b /crawl-ref/source/monstuff.cc | |
parent | 384d1e986bf2868bd6f694c695519aefe733e3a3 (diff) | |
download | crawl-ref-2739849714d0e5356dedc5b6ba8d7eb8620d0d37.tar.gz crawl-ref-2739849714d0e5356dedc5b6ba8d7eb8620d0d37.zip |
Display the proper message when a pacified monster leaves the level.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6196 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r-- | crawl-ref/source/monstuff.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 0607951151..7ecf2756ff 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -2430,22 +2430,24 @@ static int _mons_find_nearest_level_exit(const monsters *mon, // If _mons_find_level_exits() is ever expanded to handle more grid // types, this should be expanded along with it. -static void _mons_indicate_level_exit(const monsters *mon, int x, int y) +static void _mons_indicate_level_exit(const monsters *mon) { + const dungeon_feature_type dft = grd(mon->pos()); + // All types of stairs. - if (is_travelable_stair(grd[x][y])) + if (is_travelable_stair(dft)) { - command_type dir = grid_stair_direction(grd[x][y]); + command_type dir = grid_stair_direction(dft); simple_monster_message(mon, make_stringf(" %s the stairs.", dir == CMD_GO_UPSTAIRS ? "goes up" : dir == CMD_GO_DOWNSTAIRS ? "goes down" : "takes").c_str()); } - else if (is_gate(grd[x][y])) + else if (is_gate(dft)) simple_monster_message(mon, " passes through the gate."); // Any place the monster can submerge. - else if (monster_can_submerge(mon, grd[x][y])) + else if (monster_can_submerge(mon, dft)) { simple_monster_message(mon, make_stringf(" disappears into %s!", @@ -2460,7 +2462,7 @@ void make_mons_leave_level(monsters *mon) if (mons_is_pacified(mon)) { if (mons_near(mon) && player_monster_visible(mon)) - _mons_indicate_level_exit(mon, mon->target_x, mon->target_y); + _mons_indicate_level_exit(mon); // Pacified monsters leaving the level take their stuff with // them. |