(Release) Lock item

02/16/2022 12:00 Miracle`#16
Quote:
Originally Posted by Hikari Kuina View Post
for you error CItemElem::SetFlag here's the solution
It was posted up you have to read the article.

For the error AddDefinedText identifier not found

For the Lockitem is not a member of CUser

void SetFlag(BYTE byFlag, BOOL bEnable = TRUE) { if (bEnable) m_byFlag |= byFlag; else m_byFlag &= ~byFlag; }

Where do i put this code?
02/16/2022 17:58 LookAtTheFlower#17
Quote:
Originally Posted by Miracle` View Post
void SetFlag(BYTE byFlag, BOOL bEnable = TRUE) { if (bEnable) m_byFlag |= byFlag; else m_byFlag &= ~byFlag; }

Where do i put this code?
class CItemElem : public CItemBase In Item.h
01/23/2024 11:38 Stathaim#18
Thanks for this, i probably will use it :awesome:
07/11/2024 02:03 blankflyff#19
HOW SHOULD I ADD THIS


WndShop.cpp
Code:
#ifdef __LOCK_ITEM
if (pItemElem->IsFlag(CItemElem::locked))
{
g_WndMng.PutString(prj.GetText(TID_GAME_ERROR_UNDE STRUCTABLE_ITEM), NULL, prj.GetTextColor(TID_GAME_ERROR_UNDESTRUCTABLE_ITE M));
return FALSE;
}
#endif // __LOCK_ITEM


IF I DONT HAVE THIS BELOW

if( bWarning )
{
SAFE_DELETE( m_pWndWarning );
SAFE_DELETE( m_pWndConfirmSell );
m_pWndWarning = new CWndWarning;
m_pWndWarning->m_pItemElem = (CItemElem*)lpShortcut->m_dwData;
m_pWndWarning->m_pMover = m_pMover;
m_pWndWarning->Initialize( this, APP_WARNING );
}


MINE IS LIKE THIS

bResult = FALSE;
}

if (bResult && pWndFrame->GetWndId() == APP_INVENTORY)
{
if (FALSE == g_pPlayer->m_Inventory.IsEquip(itemElem->m_dwObjId))
{
SAFE_DELETE(m_pWndConfirmSell);
m_pWndConfirmSell = new CWndConfirmSell;
m_pWndConfirmSell->m_pItemElem = itemElem;
m_pWndConfirmSell->m_pMover = m_pMover;
m_pWndConfirmSell->Initialize(this, APP_CONFIRM_SELL);

bForbid = FALSE;