summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/losparam.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2010-02-22 11:08:18 +0100
committerJesse Luehrs <doy@tozt.net>2010-02-22 09:42:43 -0600
commitdc1c8e047796729f556fe966cd00506a868ec76d (patch)
treec198dd57782ad6d56198c7c6942367eb36ba6049 /crawl-ref/source/losparam.cc
parent04e063a3b79877fd1b170544d3756821e3469146 (diff)
downloadcrawl-ref-dc1c8e047796729f556fe966cd00506a868ec76d.tar.gz
crawl-ref-dc1c8e047796729f556fe966cd00506a868ec76d.zip
Revert "Make trees and plants block opacity_no_trans."
This reverts commit a9af525338b34c8a527270bdb5f31574f1e333f8. opacity_no_trans was used for too many things, so this change had undesired side-effects. Will need to make pathfinding independent of opacity_no_trans instead. Fixes issues #778, #836. (cherry picked from commit 7cead1f03d9108d65b9d95142cd61d224bc2aaf4)
Diffstat (limited to 'crawl-ref/source/losparam.cc')
-rw-r--r--crawl-ref/source/losparam.cc29
1 files changed, 6 insertions, 23 deletions
diff --git a/crawl-ref/source/losparam.cc b/crawl-ref/source/losparam.cc
index 53823ce28e..ff53d43543 100644
--- a/crawl-ref/source/losparam.cc
+++ b/crawl-ref/source/losparam.cc
@@ -38,35 +38,18 @@ opacity_type opacity_fullyopaque::operator()(const coord_def& p) const
return OPC_CLEAR;
}
-static bool mons_block_no_trans(const monsters* mons)
-{
- if (mons == NULL)
- return false;
-
- switch (mons->id())
- {
- case MONS_BUSH:
- case MONS_PLANT:
- case MONS_OKLOB_PLANT:
- case MONS_FUNGUS:
- return true;
- default:
- return false;
- }
-}
-
-// Make transparent obstacles block in addition to normal LOS.
-// This is used for example for monster pathfinding, so things
-// that should be walked around should be opaque.
+// Make transparent walls block in addition to normal LOS.
opacity_type opacity_no_trans::operator()(const coord_def& p) const
{
dungeon_feature_type f = env.grid(p);
- if (feat_is_opaque(f) || feat_is_wall(f) || f == DNGN_TREES)
- return OPC_OPAQUE;
- else if (mons_block_no_trans(monster_at(p)))
+ if (feat_is_opaque(f) || feat_is_wall(f))
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;
}