From d10be5215960be0b619d2c968d1455e39bd881d2 Mon Sep 17 00:00:00 2001 From: jkraybill Date: Sun, 1 Mar 2020 16:09:27 +1100 Subject: [PATCH] fix charcoal reloading issue in #38462 --- src/iexamine.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/iexamine.cpp b/src/iexamine.cpp index 61b61cd306dc5..aa8f51c788f82 100644 --- a/src/iexamine.cpp +++ b/src/iexamine.cpp @@ -3628,10 +3628,15 @@ void iexamine::reload_furniture( player &p, const tripoint &examp ) if( amount_in_furn > 0 ) { if( p.query_yn( _( "The %1$s contains %2$d %3$s. Unload?" ), f.name(), amount_in_furn, ammo->nname( amount_in_furn ) ) ) { - p.assign_activity( ACT_PICKUP ); - p.activity.targets.emplace_back( map_cursor( examp ), &g->m.i_at( examp ).only_item() ); - p.activity.values.push_back( 0 ); - return; + auto items = g->m.i_at( examp ); + for( auto &itm : items ) { + if( itm.type == ammo ) { + p.assign_activity( ACT_PICKUP ); + p.activity.targets.emplace_back( map_cursor( examp ), &itm ); + p.activity.values.push_back( 0 ); + return; + } + } } }