summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-29 02:43:46 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-29 02:43:46 +0000
commit9bf5023ad31b71baba9f13bae65570dfdc848259 (patch)
treef2fe1348e584f00c98ecf6e7d72e160546ce2572 /crawl-ref/source/monstuff.cc
parentd1797e64c386dec1d0569ce504da85f076ee4d6b (diff)
downloadcrawl-ref-9bf5023ad31b71baba9f13bae65570dfdc848259.tar.gz
crawl-ref-9bf5023ad31b71baba9f13bae65570dfdc848259.zip
Enable pacified monsters' traveling to teleportation traps again. They
won't make monsters leave the level, but they may teleport them far enough away that they might leave anyway. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6198 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 9e1c99af06..92d5901071 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -2385,9 +2385,11 @@ static void _mons_find_all_level_exits(const monsters *mon,
if (is_stair(gridc))
e.push_back(level_exit(coord_def(x, y), false));
- // Shaft traps.
- if (trap_type_at_xy(x, y) == TRAP_SHAFT
- && _is_trap_safe(mon, x, y))
+ // Teleportation and shaft traps.
+ const trap_type tt = trap_type_at_xy(x, y);
+ if ((tt == TRAP_TELEPORT || tt == TRAP_SHAFT)
+ && (mons_is_native_in_branch(mon)
+ || gridc != DNGN_UNDISCOVERED_TRAP))
{
e.push_back(level_exit(coord_def(x, y), false));
}
@@ -6568,7 +6570,7 @@ static int _estimated_trap_damage(trap_type trap)
}
// Check whether a given trap (described by trap position) can be
-// regarded as safe. Takes in account monster intelligence and
+// regarded as safe. Takes into account monster intelligence and
// allegiance. (just_check is used for intelligent monsters trying to
// avoid traps.)
static bool _is_trap_safe(const monsters *monster, const int trap_x,