diff options
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/monstuff.cc | 14 | ||||
-rw-r--r-- | crawl-ref/source/view.cc | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 7ce9a04998..c6934a5945 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -78,6 +78,9 @@ static bool _is_trap_safe(const monsters *monster, const coord_def& where, static bool _monster_move(monsters *monster); static spell_type _map_wand_to_mspell(int wand_type); +static bool _try_pathfind(monsters *mon, const dungeon_feature_type can_move, + bool potentially_blocking); + // [dshaligram] Doesn't need to be extern. static coord_def mmov; @@ -2555,6 +2558,17 @@ void behaviour_event(monsters *mon, int event, int src, break; mon->target = src_pos; + + // XXX: Should this be done in _handle_behaviour()? + if (src == MHITYOU && src_pos == you.pos() + && !see_grid(mon->pos())) + { + const dungeon_feature_type can_move = + (mons_amphibious(mon)) ? DNGN_DEEP_WATER + : DNGN_SHALLOW_WATER; + + _try_pathfind(mon, can_move, true); + } } break; diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 6e7878946a..c29fad0504 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -1668,7 +1668,7 @@ bool noisy(int loudness, const coord_def& where, const char *msg, bool mermaid) // If the noise came from the character, any nearby monster // will be jumping on top of them. if (where == you.pos()) - behaviour_event( monster, ME_ALERT, MHITYOU ); + behaviour_event( monster, ME_ALERT, MHITYOU, you.pos() ); else if (mermaid && mons_primary_habitat(monster) == HT_WATER && !mons_friendly(monster)) { |