summaryrefslogtreecommitdiffstats
path: root/trunk/source/dungeon.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-08-02 12:54:15 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2006-08-02 12:54:15 +0000
commitd5e5340c3926d1cf97f6cba151ffaecb20bfb35f (patch)
treed1faf7d5b27df8f3c523a8dd33357804118e62b1 /trunk/source/dungeon.cc
parent7b2204d69f21d7075e4666ee032d7a129081bc4b (diff)
downloadcrawl-ref-d5e5340c3926d1cf97f6cba151ffaecb20bfb35f.tar.gz
crawl-ref-d5e5340c3926d1cf97f6cba151ffaecb20bfb35f.zip
Integrated travel patch as of 20060727
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'trunk/source/dungeon.cc')
-rw-r--r--trunk/source/dungeon.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/trunk/source/dungeon.cc b/trunk/source/dungeon.cc
index ce002f21d2..a18ab7c726 100644
--- a/trunk/source/dungeon.cc
+++ b/trunk/source/dungeon.cc
@@ -162,7 +162,7 @@ void builder(int level_number, char level_type)
int i; // generic loop variable
int x,y; // generic map loop variables
- srandom(time(NULL));
+ // srandom(time(NULL));
// blank level with DNGN_ROCK_WALL
make_box(0,0,GXM-1,GYM-1,DNGN_ROCK_WALL,DNGN_ROCK_WALL);
@@ -450,6 +450,9 @@ int items( int allow_uniques, // not just true-false,
mitm[p].x = 0;
mitm[p].y = 0;
mitm[p].link = NON_ITEM;
+ mitm[p].slot = 0;
+ mitm[p].orig_monnum = 0;
+ mitm[p].orig_place = 0;
// cap item_level unless an acquirement-level item {dlb}:
if (item_level > 50 && item_level != MAKE_GOOD_ITEM)
@@ -2509,6 +2512,8 @@ void give_item(int mid, int level_number) //mv: cleanup+minor changes
mitm[bp].plus = 0;
mitm[bp].plus2 = 0;
mitm[bp].special = 0;
+ mitm[bp].orig_place = 0;
+ mitm[bp].orig_monnum = 0;
// this flags things to "goto give_armour" below ... {dlb}
mitm[bp].base_type = 101;
@@ -3139,6 +3144,8 @@ void give_item(int mid, int level_number) //mv: cleanup+minor changes
mitm[bp].x = 0;
mitm[bp].y = 0;
mitm[bp].link = NON_ITEM;
+ mitm[bp].orig_place = 0;
+ mitm[bp].orig_monnum = 0;
item_race = MAKE_ITEM_RANDOM_RACE;
give_level = 1 + (level_number / 2);
@@ -7540,6 +7547,14 @@ static int box_room_doors( int bx1, int bx2, int by1, int by2, int new_doors)
return doors_placed;
}
+ // Avoid an infinite loop if there are not enough good spots. --KON
+ j = 0;
+ for (i=0; i<spot_count; i++)
+ if (good_doors[i] == 1)
+ j++;
+ if (new_doors > j)
+ new_doors = j;
+
while(new_doors > 0 && spot_count > 0)
{
spot = random2(spot_count);