1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-25 22:17:45 +00:00

fix shops only charging you the cost of 1 item even if you buy multiple

This commit is contained in:
NotAdam 2018-12-04 22:27:54 +11:00
parent ed3ada4020
commit cee0ca87b4

View file

@ -22,13 +22,15 @@ bool Sapphire::World::Manager::ShopMgr::purchaseGilShopItem( Entity::Player& pla
if( !item )
return false;
if( player.getCurrency( Common::CurrencyType::Gil ) < item->priceMid )
auto price = item->priceMid * quantity;
if( player.getCurrency( Common::CurrencyType::Gil ) < price )
return false;
if( !player.addItem( gilShopItem->item, quantity ) )
return false;
player.removeCurrency( Common::CurrencyType::Gil, item->priceMid );
player.removeCurrency( Common::CurrencyType::Gil, price );
return true;
}