Make gear appear unstackable in inventories while other items remain stackable. Each individual piece of gear can now have its own stats.

This commit is contained in:
2023-12-29 06:25:54 -06:00
parent f987e51324
commit c528d89b85
17 changed files with 163 additions and 75 deletions
+5 -5
View File
@@ -185,8 +185,8 @@ void Merchant::PurchaseItem(IT item,uint32_t amt){
Inventory::AddItem(item,amt);
game->GetPlayer()->SetMoney(game->GetPlayer()->GetMoney()-totalCost);
};
void Merchant::SellItem(IT item,uint32_t amt){
sellFunctionPrimed.Validate(item,amt);
void Merchant::SellItem(std::weak_ptr<Item>item,uint32_t amt){
sellFunctionPrimed.Validate(item.lock()->ActualName(),amt);
uint32_t totalCost=0U;
bool itemFound=false;
@@ -199,10 +199,10 @@ void Merchant::SellItem(IT item,uint32_t amt){
break;
}
}
if(!itemFound&&ITEM_DATA[item].CanBePurchased()){
AddItem(item,amt); //This may not be a feature we include in future versions of the game. For now let's allow it.
if(!itemFound&&item.lock()->CanBePurchased()){
AddItem(item.lock()->ActualName(),amt); //This may not be a feature we include in future versions of the game. For now let's allow it.
}
totalCost=ITEM_DATA[item].GetSellValue()*amt;
totalCost=item.lock()->SellValue()*amt;
Inventory::RemoveItem(item,amt);
game->GetPlayer()->SetMoney(game->GetPlayer()->GetMoney()+totalCost);