Postado Maio 30, 2020 5 anos 5 minutos atrás, NTORox OTServer disse: Na minha source não tem a primeira parte do monster.h é a source do dbo rox 0.4 é normal? ver direito se é monsters.h ou monster.h me confundi também
Postado Maio 30, 2020 5 anos Autor 2 horas atrás, OinomedRellik disse: eu tenho uma duvida, essa parte do map.cpp é pra substituir né? porque se por abaixo de todo o codigo citado ele não vai funcionar eu acho mesmo error Ocultar conteúdo map.cpp:210:79: note: mismatched types ‘const __gnu_cxx::__normal_iterator<_Iterator, _Container>’ and ‘int’ monster->name = monster->getName() + " [" + atoi(level, buffer, 10) + "]"; ^ cc1plus: all warnings being treated as errors make: *** [obj/map.o] Error 1 Usa essa e delete a pasta obj: Spoiler bool Map::placeCreature(const Position& centerPos, Creature* creature, bool extendedPos /*= false*/, bool forced /*= false*/) { Monster* monster = creature->getMonster(); if(monster && g_config.getBool(ConfigManager::MONSTER_HAS_LEVEL)) { uint8_t level; if(!monster->getMonsterType()->hideLevel) { if(monster->isSummon()) { std::string value;// monster->getMaster()->getStorage((uint32_t)"1996", value); monster->getMaster()->getStorage((uint32_t)"1996", value); uint8_t intValue = atoi(value.c_str()); if(intValue || value == "0") level = intValue; else level = 1; } else level = monster->level; char buffer [10]; monster->name = monster->getName() + " [" + atoi(level, buffer, 10) + "]"; } } bool foundTile = false, placeInPz = false; Tile* tile = getTile(centerPos); if(tile) { placeInPz = tile->hasFlag(TILESTATE_PROTECTIONZONE); uint32_t flags = FLAG_IGNOREBLOCKITEM; if(creature->isAccountManager()) flags |= FLAG_IGNOREBLOCKCREATURE; ReturnValue ret = tile->__queryAdd(0, creature, 1, flags); if(forced || ret == RET_NOERROR || ret == RET_PLAYERISNOTINVITED) foundTile = true; } size_t shufflePos = 0; PairVector relList; if(extendedPos) { shufflePos = 8; relList.push_back(PositionPair(-2, 0)); relList.push_back(PositionPair(0, -2)); relList.push_back(PositionPair(0, 2)); relList.push_back(PositionPair(2, 0)); std::random_shuffle(relList.begin(), relList.end()); } relList.push_back(PositionPair(-1, -1)); relList.push_back(PositionPair(-1, 0)); relList.push_back(PositionPair(-1, 1)); relList.push_back(PositionPair(0, -1)); relList.push_back(PositionPair(0, 1)); relList.push_back(PositionPair(1, -1)); relList.push_back(PositionPair(1, 0)); relList.push_back(PositionPair(1, 1)); std::random_shuffle(relList.begin() + shufflePos, relList.end()); uint32_t radius = 1; Position tryPos; for(uint32_t n = 1; n <= radius && !foundTile; ++n) { for(PairVector::iterator it = relList.begin(); it != relList.end() && !foundTile; ++it) { int32_t dx = it->first * n, dy = it->second * n; tryPos = centerPos; tryPos.x = tryPos.x + dx; tryPos.y = tryPos.y + dy; if(!(tile = getTile(tryPos)) || (placeInPz && !tile->hasFlag(TILESTATE_PROTECTIONZONE))) continue; if(tile->__queryAdd(0, creature, 1, 0) == RET_NOERROR) { if(!extendedPos) { foundTile = true; break; } if(isSightClear(centerPos, tryPos, false)) { foundTile = true; break; } } } }
Postado Maio 30, 2020 5 anos 1 hora atrás, .HuRRiKaNe disse: Usa essa e delete a pasta obj: Mostrar conteúdo oculto bool Map::placeCreature(const Position& centerPos, Creature* creature, bool extendedPos /*= false*/, bool forced /*= false*/) { Monster* monster = creature->getMonster(); if(monster && g_config.getBool(ConfigManager::MONSTER_HAS_LEVEL)) { uint8_t level; if(!monster->getMonsterType()->hideLevel) { if(monster->isSummon()) { std::string value;// monster->getMaster()->getStorage((uint32_t)"1996", value); monster->getMaster()->getStorage((uint32_t)"1996", value); uint8_t intValue = atoi(value.c_str()); if(intValue || value == "0") level = intValue; else level = 1; } else level = monster->level; char buffer [10]; monster->name = monster->getName() + " [" + atoi(level, buffer, 10) + "]"; } } bool foundTile = false, placeInPz = false; Tile* tile = getTile(centerPos); if(tile) { placeInPz = tile->hasFlag(TILESTATE_PROTECTIONZONE); uint32_t flags = FLAG_IGNOREBLOCKITEM; if(creature->isAccountManager()) flags |= FLAG_IGNOREBLOCKCREATURE; ReturnValue ret = tile->__queryAdd(0, creature, 1, flags); if(forced || ret == RET_NOERROR || ret == RET_PLAYERISNOTINVITED) foundTile = true; } size_t shufflePos = 0; PairVector relList; if(extendedPos) { shufflePos = 8; relList.push_back(PositionPair(-2, 0)); relList.push_back(PositionPair(0, -2)); relList.push_back(PositionPair(0, 2)); relList.push_back(PositionPair(2, 0)); std::random_shuffle(relList.begin(), relList.end()); } relList.push_back(PositionPair(-1, -1)); relList.push_back(PositionPair(-1, 0)); relList.push_back(PositionPair(-1, 1)); relList.push_back(PositionPair(0, -1)); relList.push_back(PositionPair(0, 1)); relList.push_back(PositionPair(1, -1)); relList.push_back(PositionPair(1, 0)); relList.push_back(PositionPair(1, 1)); std::random_shuffle(relList.begin() + shufflePos, relList.end()); uint32_t radius = 1; Position tryPos; for(uint32_t n = 1; n <= radius && !foundTile; ++n) { for(PairVector::iterator it = relList.begin(); it != relList.end() && !foundTile; ++it) { int32_t dx = it->first * n, dy = it->second * n; tryPos = centerPos; tryPos.x = tryPos.x + dx; tryPos.y = tryPos.y + dy; if(!(tile = getTile(tryPos)) || (placeInPz && !tile->hasFlag(TILESTATE_PROTECTIONZONE))) continue; if(tile->__queryAdd(0, creature, 1, 0) == RET_NOERROR) { if(!extendedPos) { foundTile = true; break; } if(isSightClear(centerPos, tryPos, false)) { foundTile = true; break; } } } } deu mais um error, percebi que faltava >>> } <<< e ocorreu esse error depois de compilar novamente. Spoiler map.cpp:206:71: note: mismatched types ‘const __gnu_cxx::__normal_iterator<_Iterator, _Container>’ and ‘int’ monster->name = monster->getName() + " [" + atoi(level, buffer, 10) + "]"; } } ^ map.cpp:276:1: error: no return statement in function returning non-void [-Werror=return-type] } ^ cc1plus: all warnings being treated as errors make: *** [obj/map.o] Error 1
Postado Dezembro 27, 2022 2 anos nie działa, nie mogę skompilować , jak to naprawić? map.cpp: W funkcji składowej „bool Map::placeCreature(const Position&, Creature*, bool, bool)”: map.cpp:212:80: błąd: „itoa” nie została zadeklarowana w tym zakresie monster- >nazwa = potwór->getName() + " [" + itoa (poziom, bufor, 10) + "]"; done. Editado Dezembro 28, 2022 2 anos por Elo1989 (veja o histórico de edições)
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.