summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/losparam.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2010-02-22 11:18:02 +0100
committerJesse Luehrs <doy@tozt.net>2010-02-22 09:42:52 -0600
commit93af5e47818338bce7dc6cdfafde95cb312bb53f (patch)
tree41b976acc43dad07f56a4a669e9c74c98da6737f /crawl-ref/source/losparam.cc
parentdc1c8e047796729f556fe966cd00506a868ec76d (diff)
downloadcrawl-ref-93af5e47818338bce7dc6cdfafde95cb312bb53f.tar.gz
crawl-ref-93af5e47818338bce7dc6cdfafde95cb312bb53f.zip
Clean up opacity_no_trans a bit.
Base it on opc_default, and consider trees as transparent walls. opacity_no_trans currently affects a variety of things (translocations like blink/apport/portalproj, feeling safe, trap detection); it would be nice to separate these eventually. (cherry picked from commit 48b4f875decad6312c738ee4ffdb6bddbaa9a9cb)
Diffstat (limited to 'crawl-ref/source/losparam.cc')
-rw-r--r--crawl-ref/source/losparam.cc13
1 files changed, 4 insertions, 9 deletions
diff --git a/crawl-ref/source/losparam.cc b/crawl-ref/source/losparam.cc
index ff53d43543..7bbfa5ac3e 100644
--- a/crawl-ref/source/losparam.cc
+++ b/crawl-ref/source/losparam.cc
@@ -38,20 +38,15 @@ opacity_type opacity_fullyopaque::operator()(const coord_def& p) const
return OPC_CLEAR;
}
-// Make transparent walls block in addition to normal LOS.
opacity_type opacity_no_trans::operator()(const coord_def& p) const
{
+ opacity_type base = opc_default(p);
+
dungeon_feature_type f = env.grid(p);
- if (feat_is_opaque(f) || feat_is_wall(f))
+ if (feat_is_opaque(f) || feat_is_wall(f) || f == DNGN_TREES)
return OPC_OPAQUE;
- else if (is_opaque_cloud(env.cgrid(p)))
- return OPC_HALF;
- else if (f == DNGN_TREES)
- return OPC_HALF;
- else if (monster_at(p) && monster_at(p)->type == MONS_BUSH)
- return OPC_HALF;
else
- return OPC_CLEAR;
+ return base;
}
// Make anything solid block in addition to normal LOS.