From fbb959ba675a5c5b464ce5e700bc8a0c3dc49880 Mon Sep 17 00:00:00 2001 From: Kevin Granade Date: Sun, 4 Oct 2020 02:59:11 +0000 Subject: [PATCH] Don't call item::put_in on full brass catcher --- src/ranged.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ranged.cpp b/src/ranged.cpp index 5d815a9fb0858..f0ff22afcfac3 100644 --- a/src/ranged.cpp +++ b/src/ranged.cpp @@ -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 ) );