summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells3.cc
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-11-22 17:43:23 -0800
committerMatthew Cline <zelgadis@sourceforge.net>2009-11-22 17:46:23 -0800
commit55abf2cd3e897e7c06b860427a31484810b203dc (patch)
treefef35643d5555c895078dcc77e73840aae3fc9b5 /crawl-ref/source/spells3.cc
parent6442131a340ffdc33b44558d973fe1973e25bfab (diff)
downloadcrawl-ref-55abf2cd3e897e7c06b860427a31484810b203dc.tar.gz
crawl-ref-55abf2cd3e897e7c06b860427a31484810b203dc.zip
On player teleport, reset mon->foe_memory
This should fix the problem of monsters tracking the player knowing where the player teleports to.
Diffstat (limited to 'crawl-ref/source/spells3.cc')
-rw-r--r--crawl-ref/source/spells3.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index 4969da954f..a5e490fc65 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -1611,6 +1611,20 @@ static bool _teleport_player(bool allow_control, bool new_abyss_area)
if (large_change)
handle_interrupted_swap(true);
+ viewwindow(false, true);
+ for (monster_iterator mi; mi; ++mi)
+ {
+ const bool see_cell = you.see_cell(mi->pos());
+
+ if (mi->foe == MHITYOU && !see_cell)
+ {
+ mi->foe_memory = 0;
+ behaviour_event(*mi, ME_EVAL);
+ }
+ else if (see_cell)
+ behaviour_event(*mi, ME_EVAL);
+ }
+
// Might identify unknown ring of teleport control.
if (check_ring_TC)
maybe_id_ring_TC();