avoid recursion problem when 'taking all' in quarter temp inventory in EGS

This commit is contained in:
kishan_grimout 2013-04-11 14:30:00 +02:00
parent 0e0b6e11bd
commit 37f6166eb9
4 changed files with 8 additions and 8 deletions

View file

@ -188,7 +188,7 @@ protected:
/// the harvestable Mps (4 per entity)
std::vector< CCreatureRawMaterial> _Mps;
/// pointer on the harverting character
/// pointer on the harvesting character
TDataSetRow _HarvesterRowId;
/// skill used to harvest this creature

View file

@ -14167,7 +14167,7 @@ void CCharacter::sendCloseTempInventoryImpulsion()
BOMB_IF(isRecursing,"CCharacter::sendCloseTempInventoryImpulsion is recursing!",return); // **** Temp Fix 2/4 **** //
isRecursing= true; // **** Temp Fix 3/4 **** //
getAllTempInventoryItems();
getAllTempInventoryItems(false);
CMessage msgout( "IMPULSION_ID" );
msgout.serial( _Id );

View file

@ -2623,13 +2623,13 @@ public:
CGameItemPtr createItemInInventoryFreeSlot(INVENTORIES::TInventory invId, uint16 obtainedQuality, uint32 quantity, const NLMISC::CSheetId & obtainedItem, const NLMISC::CEntityId & creatorId = NLMISC::CEntityId::Unknown, const std::string * phraseId = NULL);
/// action on an item in the temp inventory (move it to bag)
void itemTempInventoryToBag(uint32 scrSlot);
void itemTempInventoryToBag(uint32 scrSlot, bool sendCloseTempImpulsion = true);
/// clear temp inventory
void clearTempInventory();
/// get all items in temp inventory
void getAllTempInventoryItems();
void getAllTempInventoryItems(bool sendCloseTempImpulsion = true);
/// return true if temp inventory is empty
bool tempInventoryEmpty();

View file

@ -1841,7 +1841,7 @@ CGameItemPtr CCharacter::createItemInInventoryFreeSlot(INVENTORIES::TInventory i
}
// ****************************************************************************
void CCharacter::itemTempInventoryToBag(uint32 srcSlot)
void CCharacter::itemTempInventoryToBag(uint32 srcSlot, bool sendCloseTempImpulsion)
{
H_AUTO(CCharacter_itemTempInventoryToBag);
@ -2015,7 +2015,7 @@ void CCharacter::itemTempInventoryToBag(uint32 srcSlot)
CWorldInstances::instance().msgToAIInstance(getInstanceNumber(), msg);
}
endHarvest();
endHarvest(sendCloseTempImpulsion);
leaveTempInventoryMode();
}
@ -2108,12 +2108,12 @@ void CCharacter::itemTempInventoryToBag(uint32 srcSlot)
}
// ****************************************************************************
void CCharacter::getAllTempInventoryItems()
void CCharacter::getAllTempInventoryItems(bool sendCloseTempImpulsion)
{
H_AUTO(CCharacter_getAllTempInventoryItems);
for (uint i = 0 ; i < INVENTORIES::NbTempInvSlots; ++i)
itemTempInventoryToBag(i);
itemTempInventoryToBag(i, sendCloseTempImpulsion);
}
// ****************************************************************************