summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/xom.cc
diff options
context:
space:
mode:
authorNicholas Feinberg <pleasingfung@gmail.com>2014-03-02 21:54:09 -0800
committerSteve Melenchuk <smelenchuk@gmail.com>2014-03-05 19:59:19 -0700
commita5274fd6dc5599ce2afdc882a46526b036e8f25f (patch)
tree8f15e6696f4a52033e064314c74b6febfa5e50d3 /crawl-ref/source/xom.cc
parent9259616cc7dcd8d058367b4d8ba84d8f49dcb898 (diff)
downloadcrawl-ref-a5274fd6dc5599ce2afdc882a46526b036e8f25f.tar.gz
crawl-ref-a5274fd6dc5599ce2afdc882a46526b036e8f25f.zip
Refactored random_near_space(); fixed bugs
Cleaned up bugs in random_near_space(). Monsters can no longer blink through walls, or into lava/deep water. Ball lightning can be summoned over lava/deep water. [Committer's note: cleaned up a bit of code formatting and comments.] Signed-off-by: Steve Melenchuk <smelenchuk@gmail.com>
Diffstat (limited to 'crawl-ref/source/xom.cc')
-rw-r--r--crawl-ref/source/xom.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index 9bd984972c..f4987b6c14 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -1981,9 +1981,9 @@ static int _xom_change_scenery(bool debug = false)
const int max_altars = max(1, random2(random2(14)));
for (int tries = max_altars; tries > 0; --tries)
{
- if ((random_near_space(you.pos(), place)
+ if ((random_near_space(you.pos(), place, false)
|| random_near_space(you.pos(), place, true))
- && grd(place) == DNGN_FLOOR && you.see_cell(place))
+ && grd(place) == DNGN_FLOOR)
{
if (debug)
return XOM_GOOD_SCENERY;