summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-pathfind.h
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2010-03-11 15:36:14 +0100
committerRobert Vollmert <rvollmert@gmx.net>2010-03-11 17:02:01 +0100
commit4cdaf99143c1297bdc7300893451de09c056bba4 (patch)
treee9b7151339399343313769abfd14ca3ab19a64f2 /crawl-ref/source/mon-pathfind.h
parentf4f0cf5d0b90244611aeb2622455a9606c633337 (diff)
downloadcrawl-ref-4cdaf99143c1297bdc7300893451de09c056bba4.tar.gz
crawl-ref-4cdaf99143c1297bdc7300893451de09c056bba4.zip
Fix monsters not using doors.
Previously, monsters would only open doors if they were straight on the way to their target. E.g.: @#g .+. g won't open the door if its target is @. This can be reproduced for example as follows (eg Sprint 1 start): .1#3. ..+.2 ..### Stand at one, open door, place monster at 2, close door. The monster will move to 3 and wait there until you open the door. I'm not sure why monsters didn't fall back to pathfinding if they couldn't get to you directly. These changes also unify some monster traversability checks between mon-pathfind and mon-act.
Diffstat (limited to 'crawl-ref/source/mon-pathfind.h')
-rw-r--r--crawl-ref/source/mon-pathfind.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/crawl-ref/source/mon-pathfind.h b/crawl-ref/source/mon-pathfind.h
index 9507680f31..4be31dbed1 100644
--- a/crawl-ref/source/mon-pathfind.h
+++ b/crawl-ref/source/mon-pathfind.h
@@ -26,9 +26,9 @@ public:
protected:
// protected methods
bool calc_path_to_neighbours(void);
- bool traversable(coord_def p);
+ bool traversable(const coord_def& p);
int travel_cost(coord_def npos);
- bool mons_traversable(coord_def p);
+ bool mons_traversable(const coord_def& p);
int mons_travel_cost(coord_def npos);
int estimated_cost(coord_def npos);
void add_new_pos(coord_def pos, int total);