From 00036797ff4a87871c5477f09499795676306b60 Mon Sep 17 00:00:00 2001 From: haranp Date: Wed, 22 Nov 2006 12:54:01 +0000 Subject: Goodbye, gold dropping. We wish thee well. If I misunderstood and this is still up for debate, my apologies and please revert. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@462 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/command.cc | 2 +- crawl-ref/source/invent.cc | 4 +- crawl-ref/source/items.cc | 90 +-------------------------------------------- 3 files changed, 4 insertions(+), 92 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc index 437192ad34..aaa8b458d9 100644 --- a/crawl-ref/source/command.cc +++ b/crawl-ref/source/command.cc @@ -164,7 +164,7 @@ static void adjust_item(void) -1, false, false ); - if (to_slot == PROMPT_ABORT) + if (to_slot == PROMPT_ABORT) { canned_msg( MSG_OK ); return; diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc index 437b01c4fc..f8545bb11c 100644 --- a/crawl-ref/source/invent.cc +++ b/crawl-ref/source/invent.cc @@ -619,7 +619,7 @@ std::vector prompt_invent_items( // Note: We handle any "special" character first, so that // it can be used to override the others. - if (other_valid_char != '\0' && keyin == other_valid_char) + if (other_valid_char != 0 && keyin == other_valid_char) { ret = PROMPT_GOT_SPECIAL; break; @@ -804,7 +804,7 @@ int prompt_invent_item( const char *prompt, // Note: We handle any "special" character first, so that // it can be used to override the others. - if (other_valid_char != '\0' && keyin == other_valid_char) + if (other_valid_char != 0 && keyin == other_valid_char) { ret = PROMPT_GOT_SPECIAL; break; diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index dfbacc206b..678c94fa82 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -1684,95 +1684,7 @@ bool move_top_item( int src_x, int src_y, int dest_x, int dest_y ) return (true); } - -//--------------------------------------------------------------- -// -// drop_gold -// -//--------------------------------------------------------------- -static void drop_gold(unsigned int amount) -{ - const unsigned long BIGGEST_QUANT_VALUE = - ((1L << (sizeof(mitm[0].quantity)*8 - 1)) - 1000); - - if (you.gold > 0) - { - if (amount > you.gold) - amount = you.gold; - - snprintf( info, INFO_SIZE, "You drop %d gold piece%s.", - amount, (amount > 1) ? "s" : "" ); - mpr(info); - - // loop through items at grid location, look for gold - int i = igrd[you.x_pos][you.y_pos]; - - while(i != NON_ITEM) - { - if (mitm[i].base_type == OBJ_GOLD) - { - if ( mitm[i].quantity + amount > BIGGEST_QUANT_VALUE ) { - amount = BIGGEST_QUANT_VALUE - mitm[i].quantity; - snprintf(info, INFO_SIZE, - "But there's only room for %d.", amount); - mpr(info); - - } - inc_mitm_item_quantity( i, amount ); - you.gold -= amount; - you.redraw_gold = 1; - you.turn_is_over = true; - return; - } - - // follow link - i = mitm[i].link; - } - - // place on top. - i = get_item_slot(10); - if (i == NON_ITEM) - { - mpr( "Too many items on this level, not dropping the gold." ); - return; - } - if (amount > BIGGEST_QUANT_VALUE) { - amount = BIGGEST_QUANT_VALUE; - snprintf(info, INFO_SIZE, - "But there's only room for %d.", amount); - mpr(info); - } - - mitm[i].base_type = OBJ_GOLD; - mitm[i].quantity = amount; - // [ds] #&^#@&#! - mitm[i].colour = YELLOW; - mitm[i].flags = 0; - - move_item_to_grid( &i, you.x_pos, you.y_pos ); - - you.gold -= amount; - you.redraw_gold = 1; - - you.turn_is_over = true; - } - else - { - mpr("You don't have any money."); - } -} // end drop_gold() - bool drop_item( int item_dropped, int quant_drop ) { - if (item_dropped == PROMPT_GOT_SPECIAL) // ie '$' for gold - { - // drop gold - if (quant_drop < 0 || quant_drop > static_cast< int >( you.gold )) - quant_drop = you.gold; - - drop_gold( quant_drop ); - return (true); - } - if (quant_drop < 0 || quant_drop > you.inv[item_dropped].quantity) quant_drop = you.inv[item_dropped].quantity; @@ -1959,7 +1871,7 @@ void drop(void) MT_DROP, -1, drop_menu_title, - true, true, '$', + true, true, 0, &Options.drop_filter, drop_selitem_text, &items_for_multidrop ); -- cgit v1.2.3-54-g00ecf