diff --git a/dGame/dGameMessages/GameMessages.cpp b/dGame/dGameMessages/GameMessages.cpp index 1ede443b..35e1a13c 100644 --- a/dGame/dGameMessages/GameMessages.cpp +++ b/dGame/dGameMessages/GameMessages.cpp @@ -5441,7 +5441,7 @@ void GameMessages::HandleRemoveItemFromInventory(RakNet::BitStream* inStream, En } } - item->SetCount(item->GetCount() - iStackCount, true); + item->SetCount(item->GetCount() - std::min(item->GetCount(), iStackCount), true); EntityManager::Instance()->SerializeEntity(entity); auto* missionComponent = entity->GetComponent();