Skip to content

Commit

Permalink
Merge pull request #38256 from pjf/sorted_trading
Browse files Browse the repository at this point in the history
💸npctrade💸: Remove item locations from trade window
  • Loading branch information
kevingranade authored Apr 2, 2020
2 parents d017afb + 514ef23 commit 8cf5119
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/npctrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,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 {
Expand Down Expand Up @@ -666,5 +668,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;
}

0 comments on commit 8cf5119

Please sign in to comment.