Disable game item ptr debug code when item ptr debug is disabled...

ryzomclassic-develop
kaetemi 4 years ago
parent a5e9542f2f
commit 60f61caa2c

@ -749,7 +749,9 @@ void CGameItemPtr::deleteItem()
// call dtor now to unlink all children
item->dtor();
// check no one else is referencing us
#ifdef GAME_PTR_DEBUG
nlassert(item->_Ptrs.empty());
#endif
CGameItem::deleteItem(item);
#if 0
@ -1174,10 +1176,14 @@ CGameItemPtr CGameItem::getItemCopy()
// use the default copy ctor to init it
CGameItem* item = *ret;
CGameItemPtrArray old;
old= *item;
#ifdef GAME_PTR_DEBUG
std::vector<CGameItemPtr*> old;
old= item->_Ptrs;
#endif
*item = *this;
*(CGameItemPtrArray*)item=old;
#ifdef GAME_PTR_DEBUG
*(CGameItemPtrArray*)item->_Ptrs=old;
#endif
// generate a new item id
item->_ItemId = INVENTORIES::TItemId();

@ -293,6 +293,7 @@ private:
};
#ifdef GAME_PTR_DEBUG
class CGameItemPtrArray
{
public:
@ -326,7 +327,7 @@ protected:
/// keep pointers pointing this item
std::vector<CGameItemPtr*> _Ptrs;
};
#endif
/**
* CGameItem
@ -335,8 +336,10 @@ protected:
* \author Nevrax France
* \date 2002
*/
class CGameItem :
public CGameItemPtrArray
class CGameItem
#ifdef GAME_PTR_DEBUG
: public CGameItemPtrArray
#endif
{
NLMISC_COMMAND_FRIEND(testParanoidItemSystem);

Loading…
Cancel
Save