diff --git a/src/item_pocket.cpp b/src/item_pocket.cpp index 2a303c6f4a500..e0e64b066aba9 100644 --- a/src/item_pocket.cpp +++ b/src/item_pocket.cpp @@ -903,7 +903,7 @@ void item_pocket::overflow( const tripoint &pos ) for( auto iter = contents.begin(); iter != contents.end(); ) { item &ammo = *iter; total_qty += ammo.count(); - const int overflow_count = ammo_iter->second - ammo.count() - total_qty; + const int overflow_count = total_qty - ammo_iter->second; if( overflow_count > 0 ) { ammo.charges -= overflow_count; item dropped_ammo( ammo.typeId(), ammo.birthday(), overflow_count ); diff --git a/src/pickup.cpp b/src/pickup.cpp index 36c1fdde5167f..1c25a75a1528b 100644 --- a/src/pickup.cpp +++ b/src/pickup.cpp @@ -261,9 +261,9 @@ bool pick_one_up( item_location &loc, int quantity, bool &got_water, bool &offer bool did_prompt = false; if( newit.count_by_charges() ) { - newit.charges = u.i_add_to_container( newit, false ); + newit.charges -= u.i_add( newit ).charges; } - if( newit.is_ammo() && newit.charges == 0 ) { + if( newit.is_ammo() && newit.charges <= 0 ) { picked_up = true; option = NUM_ANSWERS; //Skip the options part } else if( newit.is_frozen_liquid() ) {