From 18050028e312c1f98a3b8aa1eca1c28c427c3366 Mon Sep 17 00:00:00 2001 From: Aleos Date: Wed, 1 Jun 2022 11:00:48 -0400 Subject: [PATCH] Adds safety check for Barter Shops (#6995) * Fixes #6895. * Adds a safety check for multiple non-stackable items being used as the purchase type. Thanks to @samers1! --- src/map/npc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/map/npc.cpp b/src/map/npc.cpp index 9184c1e4ea..80a784906f 100644 --- a/src/map/npc.cpp +++ b/src/map/npc.cpp @@ -3120,7 +3120,7 @@ e_purchase_result npc_barter_purchase( struct map_session_data& sd, std::shared_ return e_purchase_result::PURCHASE_FAIL_GOODS; } }else{ - for( int i = 0; i < requirement->amount; i++ ){ + for( int i = 0; i < (requirement->amount * amount); i++ ){ int j; for( j = 0; j < MAX_INVENTORY; j++ ){