Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💸npctrade💸: Remove item locations from trade window #38256

Merged
merged 1 commit into from
Apr 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/npctrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
}