Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

Commit

Permalink
change amount values from uint8 to uint32 fixes issue #6282
Browse files Browse the repository at this point in the history
  • Loading branch information
TeoTwawki committed Jan 16, 2020
1 parent 563f9a1 commit 338bf70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/map/trade_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,11 @@ void CTradeContainer::setQuantity(uint8 slotID, uint32 quantity)
return;
}

bool CTradeContainer::setConfirmedStatus(uint8 slotID, uint8 amount)
bool CTradeContainer::setConfirmedStatus(uint8 slotID, uint32 amount)
{
if (slotID < m_PItem.size() && m_PItem[slotID] && m_PItem[slotID]->getQuantity() >= amount)
{
m_confirmed[slotID] = std::min<uint8>(amount, m_PItem[slotID]->getQuantity());
m_confirmed[slotID] = std::min<uint32>(amount, m_PItem[slotID]->getQuantity());
return true;
}
return false;
Expand Down
4 changes: 2 additions & 2 deletions src/map/trade_container.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class CTradeContainer
void setItemID(uint8 slotID, uint16 itemID);
void setInvSlotID(uint8 slotID, uint8 invSlotID);
void setQuantity(uint8 slotID, uint32 quantity);
bool setConfirmedStatus(uint8 slotID, uint8 amount);
bool setConfirmedStatus(uint8 slotID, uint32 amount);
void setItem(uint8 slotID, uint16 itemID, uint8 invSlotID, uint32 quantity, CItem* item = nullptr);
void setSize(uint8 size);

Expand All @@ -86,7 +86,7 @@ class CTradeContainer
std::vector<uint8> m_slotID;
std::vector<uint16> m_itemID;
std::vector<uint32> m_quantity;
std::vector<uint8> m_confirmed;
std::vector<uint32> m_confirmed;
};

#endif

0 comments on commit 338bf70

Please sign in to comment.