Skip to content

Commit

Permalink
Don't call item::put_in on full brass catcher
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingranade committed Oct 4, 2020
1 parent e3212b2 commit fbb959b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ranged.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1585,9 +1585,10 @@ static void cycle_action( item &weap, const tripoint &pos )
const itype_id casing = *weap.ammo_data()->ammo->casing;
if( weap.has_flag( "RELOAD_EJECT" ) ) {
weap.put_in( item( casing ).set_flag( "CASING" ), item_pocket::pocket_type::CONTAINER );
} else if( !( brass_catcher && brass_catcher->put_in( item( casing ),
item_pocket::pocket_type::CONTAINER ).success() ) ) {
if( cargo.empty() ) {
} else {
if( brass_catcher && brass_catcher->can_contain( casing.obj() ) ) {
brass_catcher->put_in( item( casing ), item_pocket::pocket_type::CONTAINER );
} else if( cargo.empty() ) {
here.add_item_or_charges( eject, item( casing ) );
} else {
vp->vehicle().add_item( *cargo.front(), item( casing ) );
Expand Down

0 comments on commit fbb959b

Please sign in to comment.