Address modular build not returning parts upon switching some out (#614)

This commit is contained in:
David Markowitz 2022-07-05 23:18:04 -07:00 committed by GitHub
parent 8cdb388915
commit 3cf243b1d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5514,13 +5514,15 @@ void GameMessages::HandleMoveItemBetweenInventoryTypes(RakNet::BitStream* inStre
auto* item = inv->FindItemById(objectID);
if (item == nullptr)
{
item = inv->FindItemByLot(templateID);
if (item == nullptr)
{
return;
if (!item) {
// Attempt to find the item by lot in inventory A since A is the source inventory.
item = inv->FindItemByLot(templateID, static_cast<eInventoryType>(inventoryTypeA));
if (!item) {
// As a final resort, try to find the item in its default inventory based on type.
item = inv->FindItemByLot(templateID);
if (!item) {
return;
}
}
}