Skip to content

Commit

Permalink
Update crafting.cpp
Browse files Browse the repository at this point in the history
incorporate BevapDin's suggested revisions
  • Loading branch information
SeventhSandwich committed Feb 5, 2020
1 parent 06c5177 commit 067b290
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/crafting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 );
}
Expand Down

0 comments on commit 067b290

Please sign in to comment.