Fix a crash

--HG--
branch : item_group
hg/compatibility-develop
Guillaume Dupuy 8 years ago
parent 6c9bbb8c0b
commit 54ff3a88d5

@ -264,9 +264,10 @@ bool CItemGroupManager::moveGroup(std::string name, INVENTORIES::TInventory dst)
INVENTORIES::TInventory inventory = (INVENTORIES::TInventory)i; INVENTORIES::TInventory inventory = (INVENTORIES::TInventory)i;
if (inventory != dst && pIM->isInventoryAvailable(inventory)) if (inventory != dst && pIM->isInventoryAvailable(inventory))
{ {
for(auto &item : matchingItems(group, inventory)) for(auto &item : matchingItems(group, inventory))
{ {
//If an item is currently equipped, don't move it (or else crash !!)
if(pIM->isBagItemWeared(item.indexInBag)) continue;
CAHManager::getInstance()->runActionHandler("move_item", item.pCS, moveParams); CAHManager::getInstance()->runActionHandler("move_item", item.pCS, moveParams);
} }

Loading…
Cancel
Save