Skip to content

Commit

Permalink
Prevent nearby NPC-owned items showing up in trades unless they are a…
Browse files Browse the repository at this point in the history
… shopkeeper.
  • Loading branch information
ealexadam authored and Rivet-the-Zombie committed Apr 12, 2020
1 parent 8eafa19 commit fc47a70
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/npctrade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,14 @@ std::vector<item_pricing> 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 );
}
Expand Down

0 comments on commit fc47a70

Please sign in to comment.