summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-act.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-11-05 20:50:54 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-11-05 22:30:03 +0100
commitdc3f573c6ef467ddcc4a837ce90ca9df3b502c2e (patch)
treef7915736d0a9bad11d83c3ff8a0263577a27e979 /crawl-ref/source/mon-act.cc
parent31124ec682c2b826f169c23e808fa741a3033a04 (diff)
downloadcrawl-ref-dc3f573c6ef467ddcc4a837ce90ca9df3b502c2e.tar.gz
crawl-ref-dc3f573c6ef467ddcc4a837ce90ca9df3b502c2e.zip
Unify mesmerisation code.
There were several places that had copies of the same code, checking whether mesmerisation blocked movement to a given target. The various mesmerisation functions have become methods of player and were moved into behold.cc.
Diffstat (limited to 'crawl-ref/source/mon-act.cc')
-rw-r--r--crawl-ref/source/mon-act.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/crawl-ref/source/mon-act.cc b/crawl-ref/source/mon-act.cc
index 09f3a93c80..ebd07d6fcf 100644
--- a/crawl-ref/source/mon-act.cc
+++ b/crawl-ref/source/mon-act.cc
@@ -2040,7 +2040,7 @@ static void _handle_monster_move(monsters *monster)
if (mons_cannot_move(monster) || !_monster_move(monster))
monster->speed_increment -= non_move_energy;
}
- update_beholders(monster);
+ you.update_beholder(monster);
// Reevaluate behaviour, since the monster's surroundings have
// changed (it may have moved, or died for that matter). Don't
@@ -2087,11 +2087,7 @@ void handle_monsters()
if (you.banished)
{
// Clear list of mesmerising monsters.
- if (you.duration[DUR_MESMERISED])
- {
- you.mesmerised_by.clear();
- you.duration[DUR_MESMERISED] = 0;
- }
+ you.clear_beholders();
break;
}
}