From f0d2f508065d3ef702d8a2a26c19cce5e9068557 Mon Sep 17 00:00:00 2001 From: Anton Burmistrov Date: Fri, 22 Nov 2024 01:22:30 +0400 Subject: [PATCH] Items salvaged from cutting will now be placed in vehicle, if you're cutting them in vehicle (#77910) * Items salvaged from cutting will now be placed in vehicle, if there's any * Remove unused variable --- src/iuse_actor.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/iuse_actor.cpp b/src/iuse_actor.cpp index f6c4fe7767432..68687af62f191 100644 --- a/src/iuse_actor.cpp +++ b/src/iuse_actor.cpp @@ -1806,7 +1806,6 @@ void salvage_actor::cut_up( Character &p, item_location &cut ) const // Force an encumbrance update in case they were wearing that item. p.calc_encumbrance(); - map &here = get_map(); for( const auto &salvaged_mat : salvage ) { item result( salvaged_mat.first, calendar::turn ); int amount = salvaged_mat.second; @@ -1826,7 +1825,7 @@ void salvage_actor::cut_up( Character &p, item_location &cut ) const p.i_add_or_drop( result, amount ); } else { for( int i = 0; i < amount; i++ ) { - here.add_item_or_charges( pos, result ); + put_into_vehicle_or_drop( p, item_drop_reason::deliberate, { result }, pos ); } } } else {