diff options
author | Jude Brown <bookofjude@users.sourceforge.net> | 2009-10-24 12:25:46 +1000 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-10-24 14:37:58 +0200 |
commit | e4d195a439f1cbcd6a4302a3fd7d7454cfb04d42 (patch) | |
tree | 4f8e1c5dcfbe42561fa28d5918b2778b8345fb5e /crawl-ref | |
parent | 394fb595f6d03fa9d266ed28726975e0b59bc798 (diff) | |
download | crawl-ref-e4d195a439f1cbcd6a4302a3fd7d7454cfb04d42.tar.gz crawl-ref-e4d195a439f1cbcd6a4302a3fd7d7454cfb04d42.zip |
Make FPROP_FORCE_EXCLUDE set an actual travel exclusion.
FPROP_FORCE_EXCLUDE now sets an actual travel exclusion rather than
bypassing the travel exclusion system. Exclusions are single
squares.
Signed-off-by: Jude Brown <bookofjude@users.sourceforge.net>
Signed-off-by: Robert Vollmert <rvollmert@gmx.net>
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/mapdef.cc | 8 | ||||
-rw-r--r-- | crawl-ref/source/travel.cc | 8 | ||||
-rw-r--r-- | crawl-ref/source/travel.h | 20 |
3 files changed, 18 insertions, 18 deletions
diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc index 2761d1762d..acaf48f3e9 100644 --- a/crawl-ref/source/mapdef.cc +++ b/crawl-ref/source/mapdef.cc @@ -468,9 +468,11 @@ void map_lines::apply_grid_overlay(const coord_def &c) dgn_set_grid_colour_at(gc, colour); const int property = (*overlay)(x, y).property; - if (property >= FPROP_BLOODY) - // Over-ride whatever property is already there. - env.map(gc).property |= property; + if (testbits(property, FPROP_FORCE_EXCLUDE)) + set_exclude(gc, 0, false, true); + else if (property >= FPROP_BLOODY) + // Over-ride whatever property is already there. + env.map(gc).property |= property; #ifdef USE_TILE const int floor = (*overlay)(x, y).floortile; if (floor) diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index b17b3bb446..6eeb0f632a 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -365,10 +365,6 @@ static bool _is_excluded(const coord_def &p, bool is_excluded(const coord_def &p) { - // We can force a travel exclusion by using the "force_exclude" - // KPROP feature property in vaults. {due} - if (testbits(env.map(p).property, FPROP_FORCE_EXCLUDE)) - return (true); return _is_excluded(p, curr_excludes); } @@ -493,7 +489,7 @@ void del_exclude(const coord_def &p) } // Set or update an exclude. -void set_exclude(const coord_def &p, int radius, bool autoexcl) +void set_exclude(const coord_def &p, int radius, bool autoexcl, bool vaultexcl) { // Sanity checks; excludes can be set in Pan and regular dungeon // levels only. @@ -515,7 +511,7 @@ void set_exclude(const coord_def &p, int radius, bool autoexcl) if (m && mons_near(m) && you.can_see(m)) montype = m->type; - curr_excludes.push_back(travel_exclude(p, radius, autoexcl, montype)); + curr_excludes.push_back(travel_exclude(p, radius, autoexcl, montype, vaultexcl)); } _exclude_update(p); diff --git a/crawl-ref/source/travel.h b/crawl-ref/source/travel.h index 42232088f2..51b5cfdf4d 100644 --- a/crawl-ref/source/travel.h +++ b/crawl-ref/source/travel.h @@ -63,7 +63,7 @@ void travel_init_new_level(); void cycle_exclude_radius(const coord_def &p); void del_exclude(const coord_def &p); void set_exclude(const coord_def &p, int radius = LOS_RADIUS, - bool autoexcl = false); + bool autoexcl = false, bool vaultexcl = false); void maybe_remove_autoexclusion(const coord_def &p); std::string get_exclusion_desc(); void clear_excludes(); @@ -352,20 +352,22 @@ void update_exclusion_los(std::vector<coord_def> changed); struct travel_exclude { - coord_def pos; // exclusion centre - int radius; // exclusion radius - bool autoexclude; // Was set automatically. - int mon; // Monster around which exclusion is centered. - los_def los; // los from exclusion centre - bool uptodate; // Is los up to date? + coord_def pos; // exclusion centre + int radius; // exclusion radius + bool autoexclude; // Was set automatically. + int mon; // Monster around which exclusion is centered. + los_def los; // los from exclusion centre + bool uptodate; // Is los up to date? + bool vaultexclude; // Is this exclusion set by a vault? int radius_sq() const; void set_los(); bool affects(const coord_def& p) const; travel_exclude(const coord_def &p, int r = LOS_RADIUS, - bool autoexcl = false, int mons = NON_MONSTER) - : pos(p), radius(r), autoexclude(autoexcl), mon(mons) + bool autoexcl = false, int mons = NON_MONSTER, + bool vaultexcl = false) + : pos(p), radius(r), autoexclude(autoexcl), mon(mons), vaultexclude(vaultexcl) { set_los(); } |