fixed possible 64+64 error

This commit is contained in:
Marc Lorenz 2021-12-21 12:45:05 +01:00 committed by Alexander Harkness
parent 5fa68ea807
commit 00dbbabc5c

View File

@ -45,11 +45,8 @@ public:
cItem & Item = OtherPickup.GetItem();
if ((Distance < 1.2) && Item.IsEqual(m_Pickup->GetItem()) && OtherPickup.CanCombine())
{
char CombineCount = Item.m_ItemCount;
if ((CombineCount + m_Pickup->GetItem().m_ItemCount) > Item.GetMaxStackSize())
{
CombineCount = Item.GetMaxStackSize() - m_Pickup->GetItem().m_ItemCount;
}
short CombineCount = static_cast<short>(Item.m_ItemCount);
if ((CombineCount + static_cast<short>(m_Pickup->GetItem().m_ItemCount)) > static_cast<short>(Item.GetMaxStackSize()))
if (CombineCount <= 0)
{