From 514ef23ce37cfc23bacd4ec297ee0a4834940f79 Mon Sep 17 00:00:00 2001 From: Paul Fenwick Date: Sun, 23 Feb 2020 14:24:03 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=B8npctrade=F0=9F=92=B8:=20Don't=20sho?= =?UTF-8?q?w=20item=20locations=20when=20trading=20with=20merchants.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Survivors don't really care about item locations when buying items, only when trading with allies. --- src/npctrade.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/npctrade.cpp b/src/npctrade.cpp index ea722164791e2..b761ff5164fdb 100644 --- a/src/npctrade.cpp +++ b/src/npctrade.cpp @@ -318,10 +318,12 @@ void trading_window::update_win( npc &np, const std::string &deal ) const int &owner_sells = they ? ip.u_has : ip.npc_has; const int &owner_sells_charge = they ? ip.u_charges : ip.npc_charges; std::string itname = it->display_name(); - if( ip.loc.where() != item_location::type::character ) { - itname = itname + " " + ip.loc.describe( &g->u ); + + if( np.will_exchange_items_freely() && ip.loc.where() != item_location::type::character ) { + itname = itname + " (" + ip.loc.describe( &g->u ) + ")"; color = c_light_blue; } + if( ip.charges > 0 && owner_sells_charge > 0 ) { itname += string_format( _( ": trading %d" ), owner_sells_charge ); } else { @@ -644,5 +646,5 @@ bool npc_trading::trade( npc &np, int cost, const std::string &deal ) // Will the NPC accept the trade that's currently on offer? bool trading_window::npc_will_accept_trade( const npc &np ) const { - return np.is_player_ally() || your_balance + np.max_credit_extended() > 0; + return np.will_exchange_items_freely() || your_balance + np.max_credit_extended() > 0; }