summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-place.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-12-06 10:51:37 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-12-06 10:54:54 +0100
commit0bc6cfcbda49ccb2fe6cd192e3b6b008ad784e88 (patch)
tree04d4cd1aae78952777bc02c3d23c50d304abcb2b /crawl-ref/source/mon-place.cc
parent1d8f47972e33ac222f5631a1d8b3352c7cbedc81 (diff)
downloadcrawl-ref-0bc6cfcbda49ccb2fe6cd192e3b6b008ad784e88.tar.gz
crawl-ref-0bc6cfcbda49ccb2fe6cd192e3b6b008ad784e88.zip
Check proximity when placing band members.
Previously, only the band leader was placed away from the player with PROX_AWAY_FROM_PLAYER. The solution isn't too elegant, but works for now.
Diffstat (limited to 'crawl-ref/source/mon-place.cc')
-rw-r--r--crawl-ref/source/mon-place.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-place.cc b/crawl-ref/source/mon-place.cc
index da44b4309a..e1d12cc8b6 100644
--- a/crawl-ref/source/mon-place.cc
+++ b/crawl-ref/source/mon-place.cc
@@ -724,6 +724,16 @@ static bool _valid_monster_generation_location(
return (false);
}
+ // Check player proximity to avoid band members being placed
+ // close to the player erroneously.
+ // XXX: This is a little redundant with proximity checks in
+ // place_monster.
+ if (mg.proximity == PROX_AWAY_FROM_PLAYER
+ && distance(you.pos(), mg_pos) <= LOS_RADIUS_SQ)
+ {
+ return (false);
+ }
+
// Don't generate monsters on top of teleport traps.
// (How did they get there?)
const trap_def* ptrap = find_trap(mg_pos);