From 6c28bfb45931416f84b058c770a2f80907a369f7 Mon Sep 17 00:00:00 2001 From: kishan_grimout Date: Thu, 11 Apr 2013 14:30:00 +0200 Subject: [PATCH] avoid recursion problem when 'taking all' in quarter temp inventory in EGS --HG-- branch : develop --- .../entities_game_service/creature_manager/harvestable.h | 2 +- .../entities_game_service/player_manager/character.cpp | 2 +- .../src/entities_game_service/player_manager/character.h | 4 ++-- .../player_manager/character_inventory_manipulation.cpp | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/code/ryzom/server/src/entities_game_service/creature_manager/harvestable.h b/code/ryzom/server/src/entities_game_service/creature_manager/harvestable.h index cd1ecfd06..f966e6cb0 100644 --- a/code/ryzom/server/src/entities_game_service/creature_manager/harvestable.h +++ b/code/ryzom/server/src/entities_game_service/creature_manager/harvestable.h @@ -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 diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character.cpp b/code/ryzom/server/src/entities_game_service/player_manager/character.cpp index 4a9096232..3c72995ea 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/character.cpp @@ -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 ); diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character.h b/code/ryzom/server/src/entities_game_service/player_manager/character.h index 3f97c6b3e..de6d3f110 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character.h +++ b/code/ryzom/server/src/entities_game_service/player_manager/character.h @@ -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(); diff --git a/code/ryzom/server/src/entities_game_service/player_manager/character_inventory_manipulation.cpp b/code/ryzom/server/src/entities_game_service/player_manager/character_inventory_manipulation.cpp index 2ce09282c..139cf1b4e 100644 --- a/code/ryzom/server/src/entities_game_service/player_manager/character_inventory_manipulation.cpp +++ b/code/ryzom/server/src/entities_game_service/player_manager/character_inventory_manipulation.cpp @@ -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); } // ****************************************************************************