From 99578a522dbdc7ae3b19a6ec06c61193bcd08e65 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Fri, 7 Nov 2008 23:25:16 +0000 Subject: Change floor_property (blood, sanctuary) to flags, and add two new settings: vault and highlight. Vault means a grid is part of a vault (set in dungeon.cc), and currently used to exempt vault grids when shifting labyrinths. Highlight is a meta flag currently only used to highlight labyrinth changes on the 'X' map in wizard mode, but I can think of a couple of other uses, mostly for debugging purposes. Also replace a few for loops in the lab shift function with rectangle_iterators. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7414 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/misc.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/misc.cc') diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 4eecb216f0..1b950bc588 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -1105,7 +1105,7 @@ static bool allow_bleeding_on_square(const coord_def& where) { // No bleeding onto sanctuary ground, please. // Also not necessary if already covered in blood. - if (env.map(where).property != FPROP_NONE) + if (is_bloodcovered(where) || is_sanctuary(where)) return (false); // No spattering into lava or water. @@ -1143,10 +1143,10 @@ static void maybe_bloodify_square(const coord_def& where, int amount, where.x, where.y, amount); #endif if (allow_bleeding_on_square(where)) - env.map(where).property = FPROP_BLOODY; + env.map(where).property |= FPROP_BLOODY; // If old or new blood on square, the smell reaches further. - if (env.map(where).property == FPROP_BLOODY) + if (testbits(env.map(where).property, FPROP_BLOODY)) blood_smell(12, where); else // Still allow a lingering smell. blood_smell(7, where); @@ -1191,7 +1191,7 @@ static void _spatter_neighbours(const coord_def& where, int chance) if (one_chance_in(chance)) { - env.map(*ai).property = FPROP_BLOODY; + env.map(*ai).property |= FPROP_BLOODY; _spatter_neighbours(*ai, chance+1); } } @@ -1232,7 +1232,7 @@ void generate_random_blood_spatter_on_level() startprob = min_prob + random2(max_prob); if (allow_bleeding_on_square(c)) - env.map(c).property = FPROP_BLOODY; + env.map(c).property |= FPROP_BLOODY; _spatter_neighbours(c, startprob); } } -- cgit v1.2.3-54-g00ecf