From ba7ebad8270eb70ea1bdee810c6d6203aac4792d Mon Sep 17 00:00:00 2001 From: Paul Fenwick Date: Mon, 28 Jun 2021 13:42:29 -0700 Subject: [PATCH] Allow NPCs to accept exact trades. (#49470) This solves issues where an NPC offers to train you for (say) $10, but actually insists on $10.01 or more in value. --- src/npctrade.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/npctrade.cpp b/src/npctrade.cpp index fb86e325a14df..42f2f2a05d64b 100644 --- a/src/npctrade.cpp +++ b/src/npctrade.cpp @@ -754,5 +754,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.will_exchange_items_freely() || your_balance + np.max_credit_extended() > 0; + return np.will_exchange_items_freely() || your_balance + np.max_credit_extended() >= 0; }