diff --git a/src/RandomPlayerbotFactory.cpp b/src/RandomPlayerbotFactory.cpp index 2ee1a1a0..5e44f14b 100644 --- a/src/RandomPlayerbotFactory.cpp +++ b/src/RandomPlayerbotFactory.cpp @@ -117,7 +117,7 @@ RandomPlayerbotFactory::RandomPlayerbotFactory(uint32 accountId) : accountId(acc } } -Player* RandomPlayerbotFactory::CreateRandomBot(WorldSession* session, uint8 cls, std::unordered_map> names) +Player* RandomPlayerbotFactory::CreateRandomBot(WorldSession* session, uint8 cls) { LOG_DEBUG("playerbots", "Creating new random bot for class {}", cls); @@ -130,28 +130,7 @@ Player* RandomPlayerbotFactory::CreateRandomBot(WorldSession* session, uint8 cls break; } } - std::string name; - // int tries = 10; - // while (tries--) { - // std::string cur_name; - // if (names.empty()) - name = CreateRandomBotName(gender); - // else - // { - // if (names[gender].empty()) - // return nullptr; - - // uint32 i = urand(0, names[gender].size() - 1); - // cur_name = names[gender][i]; - // std::swap(names[gender][i], names[gender].back()); - // names[gender].pop_back(); - // } - // if (ObjectMgr::CheckPlayerName(name) != CHAR_NAME_SUCCESS) - // { - // name.clear(); - // continue; - // } - // } + std::string name = CreateRandomBotName(gender); if (name.empty()) { LOG_ERROR("playerbots", "Unable to get random bot name!"); @@ -416,7 +395,6 @@ void RandomPlayerbotFactory::CreateRandomBots() uint32 totalRandomBotChars = 0; uint32 totalCharCount = sPlayerbotAIConfig->randomBotAccountCount * 10; - std::unordered_map> names; std::vector> playerBots; std::vector sessionBots; int bot_creation = 0; @@ -463,7 +441,7 @@ void RandomPlayerbotFactory::CreateRandomBots() } if (cls != 10) { - if (Player* playerBot = factory.CreateRandomBot(session, cls, names)) { + if (Player* playerBot = factory.CreateRandomBot(session, cls)) { playerBot->SaveToDB(true, false); sCharacterCache->AddCharacterCacheEntry(playerBot->GetGUID(), accountId, playerBot->GetName(), playerBot->getGender(), playerBot->getRace(), playerBot->getClass(), playerBot->GetLevel()); diff --git a/src/RandomPlayerbotFactory.h b/src/RandomPlayerbotFactory.h index f022f013..0d338d88 100644 --- a/src/RandomPlayerbotFactory.h +++ b/src/RandomPlayerbotFactory.h @@ -23,7 +23,7 @@ class RandomPlayerbotFactory RandomPlayerbotFactory(uint32 accountId); virtual ~RandomPlayerbotFactory() { } - Player* CreateRandomBot(WorldSession* session, uint8 cls, std::unordered_map> names); + Player* CreateRandomBot(WorldSession* session, uint8 cls); static void CreateRandomBots(); static void CreateRandomGuilds(); static void CreateRandomArenaTeams(ArenaType slot, uint32 count);