From f679a5b0cc0a5ea257b4cf2a618adca9d0b8c0db Mon Sep 17 00:00:00 2001 From: ennewalker Date: Sat, 7 Jun 2008 17:01:37 +0000 Subject: [1982933] [1790502] Fixing issue with vaults being generated on lava. Lava and deep water now prevent (non-clobber) vaults from being placed. Additionally, items will modify the dungeon square they're placed on so that they are placed on floor or shallow water. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5544 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/dungeon.cc | 6 ++++++ crawl-ref/source/maps.cc | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index d6d9dabdc2..fff09ee289 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -4414,6 +4414,12 @@ static void _dgn_place_item_explicit(const item_spec &spec, if (is_stackable_item(mitm[item_made]) && spec.qty > 0) mitm[item_made].quantity = spec.qty; } + + // Modify dungeon to ensure that the item is not on an invalid feature. + if (grd[x][y] == DNGN_DEEP_WATER) + grd[x][y] = DNGN_SHALLOW_WATER; + else if (grd[x][y] <= DNGN_MINMOVE || grd[x][y] == DNGN_LAVA) + grd[x][y] = DNGN_FLOOR; } static void _dgn_place_multiple_items(item_list &list, diff --git a/crawl-ref/source/maps.cc b/crawl-ref/source/maps.cc index 5681996681..518037e585 100644 --- a/crawl-ref/source/maps.cc +++ b/crawl-ref/source/maps.cc @@ -190,8 +190,7 @@ static bool bad_map_place(const map_def &map, if (!grid_is_opaque(grid) && grid != DNGN_FLOOR - && !grid_is_water(grid) - && grid != DNGN_LAVA + && grid != DNGN_SHALLOW_WATER && grid != DNGN_CLOSED_DOOR && grid != DNGN_OPEN_DOOR && grid != DNGN_SECRET_DOOR) -- cgit v1.2.3-54-g00ecf