Fix major accessory duplication bug. Release Build 8666.
This commit is contained in:
parent
133dc1a2e0
commit
b199208c9f
@ -491,9 +491,7 @@ uint32_t Inventory::GetItemCount(IT it){
|
||||
if(!_inventory.count(it)){
|
||||
return 0;
|
||||
}else
|
||||
if(ITEM_DATA.at(it).IsAccessory()){
|
||||
return 1; //We always only have 1 of any given accessory.
|
||||
}else{
|
||||
{
|
||||
auto inventory=_inventory.equal_range(it);
|
||||
return std::accumulate(inventory.first,inventory.second,0,[](int val,std::pair<IT,std::shared_ptr<Item>>it){return val+(*it.second).Amt();});
|
||||
}
|
||||
|
@ -198,9 +198,11 @@ void Menu::InitializeMerchantWindow(){
|
||||
return true;
|
||||
}
|
||||
if(item.lock()->GetItem().lock()->CanBeSold()){
|
||||
int inventoryQty=item.lock()->GetItem().lock()->IsEquippable()?1:Inventory::GetItemCount(item.lock()->GetItem().lock()->ActualName());
|
||||
|
||||
Component<ItemMenuLabel>(SELL_ITEM,"Item Sell Header")->SetItem(item.lock()->GetItem());
|
||||
Component<MenuLabel>(SELL_ITEM,"Price per item Amount Label")->SetLabel(std::to_string(item.lock()->GetItem().lock()->SellValue()));
|
||||
Component<MenuLabel>(SELL_ITEM,"Amount to sell Amount Label")->SetLabel(std::format("{}/{}",1,Inventory::GetItemCount(item.lock()->GetItem().lock()->ActualName())));
|
||||
Component<MenuLabel>(SELL_ITEM,"Amount to sell Amount Label")->SetLabel(std::format("{}/{}",1,inventoryQty));
|
||||
Component<MenuLabel>(SELL_ITEM,"Total Price Amount Label")->SetLabel(std::to_string(item.lock()->GetItem().lock()->SellValue()));
|
||||
Merchant&merchant=Merchant::GetCurrentTravelingMerchant();
|
||||
bool canPurchase=merchant.CanSellItem(item.lock()->GetItem(),1);
|
||||
@ -213,7 +215,6 @@ void Menu::InitializeMerchantWindow(){
|
||||
Component<MenuComponent>(SELL_ITEM,"Decrease sell amount Button")->SetGrayedOut(true);
|
||||
|
||||
int qty=1;
|
||||
int inventoryQty=Inventory::GetItemCount(item.lock()->GetItem().lock()->ActualName());
|
||||
if(qty>=inventoryQty){
|
||||
Component<MenuComponent>(SELL_ITEM,"Increase sell amount Button")->SetGrayedOut(true);
|
||||
}else{
|
||||
|
@ -39,7 +39,7 @@ All rights reserved.
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 1
|
||||
#define VERSION_PATCH 0
|
||||
#define VERSION_BUILD 8656
|
||||
#define VERSION_BUILD 8666
|
||||
|
||||
#define stringify(a) stringify_(a)
|
||||
#define stringify_(a) #a
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user