From 9fd7f5bc149e7fa7ae2597bc39ca7fd348997424 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Wed, 11 Jun 2008 22:55:29 +0000 Subject: Extend monster pathfinding to monsters circumventing pools of deep water or lava. I've added some more checks to avoid hampering performance too much, but of course there's still space for improvement. Once per turn check whether the player can see water and/or lava, and only if this is the case run the additional checks (monster habitat, grid_see_grid) when a monster tries to move. Smart monsters that have a ranged attack won't use pathfinding either since they can directly fire at the player. (This is identical to their pre-pathfinding behaviour.) Also fix butterflies really not interrupting resting. (Setting it to 0 doesn't work for some reason.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5737 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/items.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/items.cc') diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index d4ff6e63fa..ff35d4dab1 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -2279,7 +2279,7 @@ bool can_autopickup() static void _do_autopickup() { //David Loewenstern 6/99 - int n_did_pickup = 0; + int n_did_pickup = 0; int n_tried_pickup = 0; will_autopickup = false; @@ -2300,22 +2300,24 @@ static void _do_autopickup() if (item_needs_autopickup(mitm[o])) { int num_to_take = mitm[o].quantity; - if ( Options.autopickup_no_burden && item_mass(mitm[o]) != 0) + if (Options.autopickup_no_burden && item_mass(mitm[o]) != 0) { int num_can_take = (carrying_capacity(you.burden_state) - you.burden) / - item_mass(mitm[o]); + item_mass(mitm[o]); - if ( num_can_take < num_to_take ) + if (num_can_take < num_to_take) { if (!n_tried_pickup) + { mpr("You can't pick everything up without burdening " "yourself."); + } n_tried_pickup++; num_to_take = num_can_take; } - if ( num_can_take == 0 ) + if (num_can_take == 0) { o = next; continue; -- cgit v1.2.3-54-g00ecf