diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-07 08:31:45 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-07 08:31:45 +0000 |
commit | faca2fd92e2ba17f40f4a5c08d4f88dd25ae7085 (patch) | |
tree | e280b3b2841845a5c94429a9a2a7cf29053184de /crawl-ref/source/monplace.cc | |
parent | b58fbcfafc44bc2810863a3722bee2e6a8f7d22d (diff) | |
download | crawl-ref-faca2fd92e2ba17f40f4a5c08d4f88dd25ae7085.tar.gz crawl-ref-faca2fd92e2ba17f40f4a5c08d4f88dd25ae7085.zip |
Added support for "no_monster_gen" tag.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@586 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monplace.cc')
-rw-r--r-- | crawl-ref/source/monplace.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc index 569181f0af..c1572cc0f7 100644 --- a/crawl-ref/source/monplace.cc +++ b/crawl-ref/source/monplace.cc @@ -134,8 +134,9 @@ bool monster_can_submerge(int monster_class, int grid) } bool place_monster(int &id, int mon_type, int power, char behaviour, - int target, bool summoned, int px, int py, bool allow_bands, - int proximity, int extra, int dur) + int target, bool summoned, int px, int py, bool allow_bands, + int proximity, int extra, int dur, + const dgn_region_list &forbidden) { int band_size = 0; int band_monsters[BIG_BAND]; // band monster types @@ -286,7 +287,8 @@ bool place_monster(int &id, int mon_type, int power, char behaviour, tries = 0; } } - else if (tries > 60) + // Dropped number of tries from 60. + else if (tries > 45) return (false); px = 5 + random2(GXM - 10); @@ -303,6 +305,10 @@ bool place_monster(int &id, int mon_type, int power, char behaviour, if (!grid_compatible(grid_wanted, grd[px][py], true)) continue; + // Is the grid verboten? + if (!unforbidden( coord_def(px, py), forbidden )) + continue; + // don't generate monsters on top of teleport traps // (how did they get there?) int trap = trap_at_xy(px, py); |