From faca2fd92e2ba17f40f4a5c08d4f88dd25ae7085 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Thu, 7 Dec 2006 08:31:45 +0000 Subject: 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 --- crawl-ref/source/monplace.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source/monplace.cc') 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); -- cgit v1.2.3-54-g00ecf