properly extract inventory item quantity in Steam_Inventory::GetResultItems()

This commit is contained in:
a 2024-12-06 23:08:32 +02:00
parent f6ec01fd49
commit b63140ca63

View File

@ -164,7 +164,7 @@ bool Steam_Inventory::GetResultItems( SteamInventoryResult_t resultHandle,
pOutItemsArray->m_itemId = pOutItemsArray->m_iDefinition; pOutItemsArray->m_itemId = pOutItemsArray->m_iDefinition;
try try
{ {
pOutItemsArray->m_unQuantity = i.value().get<int>(); pOutItemsArray->m_unQuantity = i->value("quantity", static_cast<uint16>(0));
} }
catch (...) catch (...)
{ {
@ -183,7 +183,7 @@ bool Steam_Inventory::GetResultItems( SteamInventoryResult_t resultHandle,
try try
{ {
pOutItemsArray->m_unQuantity = it->get<int>(); pOutItemsArray->m_unQuantity = it->value("quantity", static_cast<uint16>(0));
} }
catch (...) catch (...)
{ {