From fc47a700b01aed7eaa02efed4cc7f51ec8304b42 Mon Sep 17 00:00:00 2001 From: Tiefoone Date: Sat, 4 Apr 2020 18:05:20 +1300 Subject: [PATCH] Prevent nearby NPC-owned items showing up in trades unless they are a shopkeeper. --- src/npctrade.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/npctrade.cpp b/src/npctrade.cpp index 90ca0cc5da79f..cfaaafb77d36e 100644 --- a/src/npctrade.cpp +++ b/src/npctrade.cpp @@ -177,9 +177,14 @@ std::vector npc_trading::init_buying( player &buyer, player &selle check_item( item_location( seller, &seller.weapon ), 1 ); } - for( map_cursor &cursor : map_selector( seller.pos(), PICKUP_RANGE ) ) { - buy_helper( cursor, check_item ); + //nearby items owned by the NPC will only show up in + //the trade window if the NPC is also a shopkeeper + if( np.mission == NPC_MISSION_SHOPKEEP ) { + for( map_cursor &cursor : map_selector( seller.pos(), PICKUP_RANGE ) ) { + buy_helper( cursor, check_item ); + } } + for( vehicle_cursor &cursor : vehicle_selector( seller.pos(), 1 ) ) { buy_helper( cursor, check_item ); }