summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/acr.cc6
-rw-r--r--crawl-ref/source/view.cc29
-rw-r--r--crawl-ref/source/view.h1
3 files changed, 25 insertions, 11 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index b66013059c..80019c23b0 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -809,11 +809,13 @@ bool apply_berserk_penalty = false;
This function handles the player's input. It's called from main(), from
inside an endless loop.
*/
-static void input() {
-
+static void input()
+{
you.turn_is_over = false;
prep_input();
+ fire_monster_alerts();
+
if ( you.paralysis )
{
world_reacts();
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 5a9c49b10c..a23c710cbd 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -645,15 +645,6 @@ void monster_grid(bool do_updates)
}
continue;
}
- else if (!do_updates
- && !mons_is_submerged( monster )
- && !mons_friendly( monster )
- && !mons_is_mimic( monster->type )
- && !mons_class_flag( monster->type, M_NO_EXP_GAIN ))
- {
- interrupt_activity( AI_SEE_MONSTER, monster );
- seen_monster( monster );
- }
// mimics are always left on map
if (!mons_is_mimic( monster->type ))
@@ -665,6 +656,26 @@ void monster_grid(bool do_updates)
} // end "for s"
} // end monster_grid()
+void fire_monster_alerts()
+{
+ for (int s = 0; s < MAX_MONSTERS; s++)
+ {
+ monsters *monster = &menv[s];
+
+ if (monster->type != -1 && mons_near(monster))
+ {
+ if (player_monster_visible( monster )
+ && !mons_is_submerged( monster )
+ && !mons_friendly( monster )
+ && !mons_is_mimic( monster->type )
+ && !mons_class_flag( monster->type, M_NO_EXP_GAIN ))
+ {
+ interrupt_activity( AI_SEE_MONSTER, monster );
+ seen_monster( monster );
+ }
+ }
+ }
+}
bool check_awaken(int mons_aw)
{
diff --git a/crawl-ref/source/view.h b/crawl-ref/source/view.h
index 22f3b5bdf2..bd7e63ecf0 100644
--- a/crawl-ref/source/view.h
+++ b/crawl-ref/source/view.h
@@ -150,6 +150,7 @@ unsigned char get_sightmap_char(int feature);
unsigned char get_magicmap_char(int feature);
void viewwindow(bool draw_it, bool do_updates);
+void fire_monster_alerts();
bool find_ray( int sourcex, int sourcey, int targetx, int targety,
bool allow_fallback, ray_def& ray, int cycle_dir = 0 );