From fa3b58bbc845e824e835eda9230abac20528c561 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sat, 2 Dec 2006 12:07:59 +0000 Subject: 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 --- crawl-ref/source/items.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/items.cc') 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; -- cgit v1.2.3-54-g00ecf