summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/losparam.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-10-17 17:20:30 +0200
committerRobert Vollmert <rvollmert@gmx.net>2009-10-17 17:36:45 +0200
commitb151b68bd42450a4c6fccf4fbb295bd6e504f968 (patch)
treec47352b147ef78e4a4c9f6b74c56a3876beef521 /crawl-ref/source/losparam.cc
parent86adff1f485882e2495f711b4b19fbdb41db0ca7 (diff)
downloadcrawl-ref-b151b68bd42450a4c6fccf4fbb295bd6e504f968.tar.gz
crawl-ref-b151b68bd42450a4c6fccf4fbb295bd6e504f968.zip
Replace monster_los by calls to losight.
los_param got a new opacity_monmove to help. The change compiles and the game runs, but I'm unsure how to test monster pathfinding. Please tell me if anything went wrong! Removes mon-los.{cc,h}, so I'm afraid I may have broken the non-Unix builds again.
Diffstat (limited to 'crawl-ref/source/losparam.cc')
-rw-r--r--crawl-ref/source/losparam.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/crawl-ref/source/losparam.cc b/crawl-ref/source/losparam.cc
index 4f1f100244..da30165ed1 100644
--- a/crawl-ref/source/losparam.cc
+++ b/crawl-ref/source/losparam.cc
@@ -56,6 +56,15 @@ opacity_type opacity_solid::operator()(const coord_def& p) const
return OPC_CLEAR;
}
+opacity_type opacity_monmove::operator()(const coord_def& p) const
+{
+ dungeon_feature_type feat = env.grid(p);
+ if (feat < DNGN_MINMOVE || !mon.can_pass_through_feat(feat))
+ return (OPC_OPAQUE);
+ else
+ return (OPC_CLEAR);
+}
+
// LOS bounded by fixed presquared radius.
bool bounds_radius_sq::operator()(const coord_def& p) const
{