//------------------------------------------------------------------------ int CScriptBind_Inventory::GetCurrentItemId(IFunctionHandler *pH) { CInventory *pInventory = GetInventory(pH); CRY_ASSERT(pInventory); EntityId currentItemId = pInventory->GetCurrentItem(); if (currentItemId) return pH->EndFunction(ScriptHandle(currentItemId)); return pH->EndFunction(); }
//------------------------------------------------------------------------ int CScriptBind_Inventory::GetCurrentItem(IFunctionHandler *pH) { CInventory *pInventory = GetInventory(pH); CRY_ASSERT(pInventory); EntityId currentItemId = pInventory->GetCurrentItem(); if (currentItemId) { IEntity *pEntity = m_pEntitySystem->GetEntity(currentItemId); if (pEntity) return pH->EndFunction(pEntity->GetScriptTable()); } return pH->EndFunction(); }