summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-21 11:04:32 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-21 11:04:32 +0000
commit7d317e6fc0e6847a95d0c59888400f135af66cd7 (patch)
tree300529b27b82ca9ee572659368389270c5fc6597 /crawl-ref/source/misc.cc
parent6d641e67f004a7dc483e3590a1ecbde0e3ccd455 (diff)
downloadcrawl-ref-7d317e6fc0e6847a95d0c59888400f135af66cd7.tar.gz
crawl-ref-7d317e6fc0e6847a95d0c59888400f135af66cd7.zip
Remove a few more unnecessary casts.
Don't cheat on constness in _mons_has_path_to_player. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8651 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index e6c4b3d427..70f14eb31b 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -2553,8 +2553,6 @@ bool go_berserk(bool intentional)
// assumed that this is the case.
static bool _mons_has_path_to_player(const monsters *mon)
{
- int m = monster_index(mon);
-
// Don't consider sleeping monsters safe, in case the player would
// rather retreat and try another path for maximum stabbing chances.
if (mons_is_sleeping(mon))
@@ -2575,11 +2573,11 @@ static bool _mons_has_path_to_player(const monsters *mon)
if (range > 0)
mp.set_range(range);
- if (mp.init_pathfind(&menv[m], you.pos(), true, false, true))
+ if (mp.init_pathfind(mon, you.pos(), true, false, true))
return (true);
// Now we know the monster cannot possibly reach the player.
- menv[m].travel_target = MTRAV_KNOWN_UNREACHABLE;
+ mon->travel_target = MTRAV_KNOWN_UNREACHABLE;
return (false);
}