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:
parent
ed3ada4020
commit
cee0ca87b4
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
}
|
Loading…
Add table
Reference in a new issue