summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-22 21:33:09 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-22 21:33:09 +0000
commitf7cb474e41b75c37273b79d4fe5e7e24da81950d (patch)
tree522da8edfe0c522ab9fb861d9d665488d02f0413
parentfb546e8b57956a7e545617691486f09be782a85c (diff)
downloadcrawl-ref-f7cb474e41b75c37273b79d4fe5e7e24da81950d.tar.gz
crawl-ref-f7cb474e41b75c37273b79d4fe5e7e24da81950d.zip
Add miscellaneous minor fixes.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6054 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/monstuff.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index fb8ff18dd7..18f6c5a2c6 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -2297,11 +2297,11 @@ static void _check_lava_water_in_sight()
}
}
-// If a monster can see but not directly reach the player, and then fails to
-// find a path to get him, mark all surrounding (in a radius of 2) monsters
+// If a monster can see but not directly reach the target, and then fails to
+// find a path to get there, mark all surrounding (in a radius of 2) monsters
// of the same (or greater) movement restrictions as also being unable to
// find a path, so we won't need to calculate again.
-// Should there be a direct path to the player for a monster thus marked, it
+// Should there be a direct path to the target for a monster thus marked, it
// will still be able to come nearer (and the mark will then be cleared).
static void _mark_neighbours_target_unreachable(monsters *mon)
{
@@ -2984,6 +2984,7 @@ static void _handle_behaviour(monsters *mon)
mpr("No path found!");
#endif
mon->travel_target = MTRAV_UNREACHABLE;
+ // Pass information on to nearby monsters.
_mark_neighbours_target_unreachable(mon);
}
}
@@ -3297,11 +3298,15 @@ static void _handle_behaviour(monsters *mon)
return;
}
+ // If the monster can't move (or at least teleport, as a
+ // mimic can), get out.
+ if (mons_is_truly_stationary(mon))
+ break;
+
// If the monster isn't travelling toward someplace from
// which it can leave the level, and it can move (or at
// least teleport, as a mimic can), make it start doing so.
- if (mon->travel_target == MTRAV_NONE
- && !mons_is_truly_stationary(mon))
+ if (mon->travel_target == MTRAV_NONE)
{
e_index = _mons_find_nearest_level_exit(mon, e);
@@ -3424,6 +3429,7 @@ static void _handle_behaviour(monsters *mon)
mpr("No path found!");
#endif
mon->travel_target = MTRAV_UNREACHABLE;
+ // Pass information on to nearby monsters.
_mark_neighbours_target_unreachable(mon);
}
}