Dragonslayer Posted May 14, 2017 Report Share Posted May 14, 2017 Una pequeña función que hice rápida. Sirve para comprobar si tienes espacio para un item de x tamaño. La paso por si a alguien le sirve, es una tontería. Uso: questlua_pc.cpp Añadimos: Debajo de la función "int pc_get_empty_inventory_count( lua_State* L )" mismo. int pc_get_empty_inventory_size(lua_State* L) { LPCHARACTER pChar = CQuestManager::instance().GetCurrentCharacterPtr(); if (lua_isnumber(L, 1) == false){ lua_pushboolean(L, false); return 1; } int size = (int)lua_tonumber(L, 1); if (pChar != NULL) { int iEmptyCell = pChar->GetEmptyInventory(size); if (-1 == iEmptyCell) { lua_pushboolean(L, false); return 1; } lua_pushboolean(L, true); } else { lua_pushboolean(L, false); } return 1; } Y en el registro de funciones: Jaggerman, autodesk_metin2 and Shang 3 Quote Link to comment Share on other sites More sharing options...
Shang Posted May 14, 2017 Report Share Posted May 14, 2017 Buen aporte, aunque esa función ya existe en la lib questing.lua de mijago. Dragonslayer 1 Quote Link to comment Share on other sites More sharing options...
Jaggerman Posted May 15, 2017 Report Share Posted May 15, 2017 Todo aporte por pequeño que sea se agradece. Quote Link to comment Share on other sites More sharing options...
SoyComoSoyxD Posted May 15, 2017 Report Share Posted May 15, 2017 Gracias por el aporte. =) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.