diff --git a/src/crafting.cpp b/src/crafting.cpp index c1850df7e931f..04e50f4024a86 100644 --- a/src/crafting.cpp +++ b/src/crafting.cpp @@ -2172,9 +2172,12 @@ void player::complete_disassemble( item_location &target, const recipe &dis ) item newit( comp.type, calendar::turn ); // Counted-by-charge items that can be disassembled individually // have their component count multiplied by the number of charges. - if( dis_item.count_by_charges() && ( dis.has_flag( flag_UNCRAFT_SINGLE_CHARGE ) ) ) { + if( dis_item.count_by_charges() && dis.has_flag( flag_UNCRAFT_SINGLE_CHARGE ) ) { compcount *= std::min( dis_item.charges, dis.create_result().charges ); } + if (dis_item.is_ammo()) { //If ammo, overwrite component count with selected quantity of ammo + compcount *= activity.position; + } const bool is_liquid = newit.made_of( LIQUID ); if( uncraft_liquids_contained && is_liquid && newit.charges != 0 ) { // Spawn liquid item in its default container @@ -2201,10 +2204,6 @@ void player::complete_disassemble( item_location &target, const recipe &dis ) newit.ammo_set( newit.ammo_default(), newit.ammo_capacity() ); } - if( dis_item.is_ammo() ) { //If ammo, overwrite component count with selected quantity of ammo - compcount = activity.position; - } - for( ; compcount > 0; compcount-- ) { components.emplace_back( newit ); }