diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-02 12:07:59 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-02 12:07:59 +0000 |
commit | fa3b58bbc845e824e835eda9230abac20528c561 (patch) | |
tree | 43a7f5281f61e01a07d8f9a2cc04b4c973e0a0e0 /crawl-ref/source/items.cc | |
parent | 42d11f45385dc9ec3235e3292ecfc7f7411e764e (diff) | |
download | crawl-ref-fa3b58bbc845e824e835eda9230abac20528c561.tar.gz crawl-ref-fa3b58bbc845e824e835eda9230abac20528c561.zip |
Greedy-explore tweaks: speedup by not double-floodfilling, and handle inability
to pick stuff up gracefully.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@541 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/items.cc')
-rw-r--r-- | crawl-ref/source/items.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index c040288570..9a31ad7d79 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -2923,6 +2923,7 @@ static void autopickup(void) //David Loewenstern 6/99 int result, o, next; bool did_pickup = false; + bool tried_pickup = false; if (!can_autopickup()) return; @@ -2945,11 +2946,13 @@ static void autopickup(void) if (result == 0) { + tried_pickup = true; mpr("You can't carry any more."); break; } else if (result == -1) { + tried_pickup = true; mpr("Your pack is full."); break; } @@ -2968,6 +2971,10 @@ static void autopickup(void) you.turn_is_over = true; start_delay( DELAY_AUTOPICKUP, 1, unthrown ); } + // Greedy explore has no good way to deal with an item that we can't + // pick up, so the only thing to do is to stop. + else if (tried_pickup && you.running == RMODE_EXPLORE_GREEDY) + stop_delay(); } int inv_count(void) @@ -2977,7 +2984,7 @@ int inv_count(void) for(int i=0; i< ENDOFPACK; i++) { if (is_valid_item( you.inv[i] )) - count += 1; + count++; } return count; |