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
committerRobert Vollmert <rvollmert@gmx.net>2010-02-22 13:13:21 +0100
commit48b4f875decad6312c738ee4ffdb6bddbaa9a9cb (patch)
tree135ebdad6665c7510689336efd5746e4570a7199 /crawl-ref/source/losparam.cc
parent7cead1f03d9108d65b9d95142cd61d224bc2aaf4 (diff)
downloadcrawl-ref-48b4f875decad6312c738ee4ffdb6bddbaa9a9cb.tar.gz
crawl-ref-48b4f875decad6312c738ee4ffdb6bddbaa9a9cb.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.
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.