03-30-2021, 09:57 AM
Hi!
I wrote a simple bool function which allow you to add items with the gameserver! Not much difficult and maybe all of you already now ... but who cares, maybe someone will update it
static bool MakeItems(CPC* pc, CItem* pItem)
{
// if pointers are null
if (pc == NULL || pItem == NULL)
{
delete pc;
delete pItem;
LOG_ERROR(" -> NULL POINTER DETECTED!!!!");
return false;
}
//if additem function encounter some problems, we are gonna catch it
if (pc->m_inventory.addItem(pItem) == false)
{
delete pc;
delete pItem;
LOG_ERROR(" -> ADD ITEM ERROR DETECTED!!!!");
return false;
}
//else all well, can return
return true;
}

