diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-09 21:43:14 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-09 21:43:14 +0000 |
commit | a4649f7bcd32304352b4d52a9c24a8455b41e8bc (patch) | |
tree | 2653ff094f7279d0f17c76d14528f0c1cbf1c52d /crawl-ref/source/terrain.cc | |
parent | 94e75528f21fb8aa910c06893dfc46ca2785f20f (diff) | |
download | crawl-ref-a4649f7bcd32304352b4d52a9c24a8455b41e8bc.tar.gz crawl-ref-a4649f7bcd32304352b4d52a9c24a8455b41e8bc.zip |
Apply recent commits to 0.4, including Matthew's evil zoo fix.
Now how do I change the properties to native again?
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6465 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/terrain.cc')
-rw-r--r-- | crawl-ref/source/terrain.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc index 5a9587f8c4..c9fd96f293 100644 --- a/crawl-ref/source/terrain.cc +++ b/crawl-ref/source/terrain.cc @@ -235,6 +235,19 @@ void find_connected_identical(coord_def d, dungeon_feature_type ft, std::set<coord_def>& out) { if (grd[d.x][d.y] != ft) return; + + std::string prop = env.markers.property_at(d, MAT_ANY, + "connected_exclude"); + + if (!prop.empty()) + { + // Even if this square is excluded from being a part of connected + // cells, add it if it's the starting square. + if (out.size() == 0) + out.insert(d); + return; + } + if (out.insert(d).second) { find_connected_identical(coord_def(d.x+1, d.y), ft, out); @@ -250,6 +263,19 @@ void find_connected_range(coord_def d, dungeon_feature_type ft_min, std::set<coord_def>& out) { if (grd[d.x][d.y] < ft_min || grd[d.x][d.y] > ft_max) return; + + std::string prop = env.markers.property_at(d, MAT_ANY, + "connected_exclude"); + + if (!prop.empty()) + { + // Even if this square is excluded from being a part of connected + // cells, add it if it's the starting square. + if (out.size() == 0) + out.insert(d); + return; + } + if (out.insert(d).second) { find_connected_range(coord_def(d.x+1, d.y), ft_min, ft_max, out); |