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!
This commit is contained in:
Aleos 2022-06-01 11:00:48 -04:00 committed by GitHub
parent 0b3cd7f1f7
commit 18050028e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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++ ){