summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-pathfind.cc
diff options
context:
space:
mode:
authorDracoOmega <draco_omega@live.com>2013-06-23 15:29:11 -0230
committerDracoOmega <draco_omega@live.com>2013-06-24 02:21:48 -0230
commitf7e3f385c89c2f428b778005be07abce43ed07eb (patch)
treeb55fe6e0105c822dd0ec99f0e2c101fbc1413424 /crawl-ref/source/mon-pathfind.cc
parent489f5c15f997b34f657629136fe20f471a555879 (diff)
downloadcrawl-ref-f7e3f385c89c2f428b778005be07abce43ed07eb.tar.gz
crawl-ref-f7e3f385c89c2f428b778005be07abce43ed07eb.zip
Unbreak Thorn Hunter bunkering behavior
It is a somewhat alarming sign of how brittle it might be that it managed to stop working across just the commits in this branch, and the 'solution' feels like major hack to me as well. Fixing general monster pathfinding around briar patches meant that thorn hunters would no longer bother to fire through them, but instead simply walk around. Now pathfinding opacity is special-cased so that thorn hunters will consider briar patches transparent (and thus attempt to move into them, triggering their firing behavior). If someone can think of a better way to implement this, I'm all ears.
Diffstat (limited to 'crawl-ref/source/mon-pathfind.cc')
-rw-r--r--crawl-ref/source/mon-pathfind.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/crawl-ref/source/mon-pathfind.cc b/crawl-ref/source/mon-pathfind.cc
index 02aecc2b86..f3c2b88e75 100644
--- a/crawl-ref/source/mon-pathfind.cc
+++ b/crawl-ref/source/mon-pathfind.cc
@@ -415,7 +415,16 @@ bool monster_pathfind::traversable(const coord_def& p)
if (opc_immob(p) == OPC_OPAQUE
&& grd(p) != DNGN_CLOSED_DOOR && grd(p) != DNGN_SEALED_DOOR)
{
- return false;
+ // XXX: Ugly hack to make thorn hunters use their briars for defensive
+ // cover instead of just pathing around them.
+ if (mons->type == MONS_THORN_HUNTER
+ && monster_at(p)
+ && monster_at(p)->type == MONS_BRIAR_PATCH)
+ {
+ return true;
+ }
+ else
+ return false;
}
if (mons)