From 55abf2cd3e897e7c06b860427a31484810b203dc Mon Sep 17 00:00:00 2001 From: Matthew Cline Date: Sun, 22 Nov 2009 17:43:23 -0800 Subject: On player teleport, reset mon->foe_memory This should fix the problem of monsters tracking the player knowing where the player teleports to. --- crawl-ref/source/spells3.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'crawl-ref/source/spells3.cc') 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(); -- cgit v1.2.3-54-g00ecf