Postado Fevereiro 18, 2015 10 anos gostaria de saber que alguém sabe fazer alguma função que da para adicionar ml em itens , tem que alterar essa parte do código da source . agradeço deis de já! int32_t LuaInterface::luaDoItemSetAttribute(lua_State* L) { //doItemSetAttribute(uid, key, value) boost::any value; if(lua_isnumber(L, -1)) { double tmp = popFloatNumber(L); if(std::floor(tmp) < tmp) value = tmp; else value = (int32_t)tmp; } else if(lua_isboolean(L, -1)) value = popBoolean(L); else if(lua_isstring(L, -1)) value = popString(L); else { lua_pop(L, 1); errorEx("Invalid data type"); lua_pushboolean(L, false); return 1; } std::string key = popString(L); ScriptEnviroment* env = getEnv(); Item* item = env->getItemByUID(popNumber(L)); if(!item) { errorEx(getError(LUA_ERROR_ITEM_NOT_FOUND)); lua_pushboolean(L, false); return 1; } if(value.type() == typeid(int32_t)) { if(key == "uid") { int32_t tmp = boost::any_cast<int32_t>(value); if(tmp < 1000 || tmp > 0xFFFF) { errorEx("Value for protected key \"uid\" must be in range of 1000 to 65535"); lua_pushboolean(L, false); return 1; } item->setUniqueId(tmp); } else if(key == "aid") item->setActionId(boost::any_cast<int32_t>(value)); else item->setAttribute(key.c_str(), boost::any_cast<int32_t>(value)); } else item->setAttribute(key.c_str(), value); lua_pushboolean(L, true); return 1; } up Editado Fevereiro 18, 2015 10 anos por loreal (veja o histórico de edições) I like
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.