mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-13 00:58:33 +00:00
Reset added rndbots on server restart to automatically apply configuration changes (#913)
* Refactor RandomPlayerbotMgr and delete add value on restart server * Remove reset tips in conf file
This commit is contained in:
@@ -168,7 +168,6 @@ RandomPlayerbotMgr::RandomPlayerbotMgr() : PlayerbotHolder(), processTicks(0)
|
||||
if (sPlayerbotAIConfig->enabled || sPlayerbotAIConfig->randomBotAutologin)
|
||||
{
|
||||
sPlayerbotCommandServer->Start();
|
||||
PrepareTeleportCache();
|
||||
}
|
||||
|
||||
BattlegroundData.clear(); // Clear here and here only.
|
||||
@@ -1748,6 +1747,22 @@ void RandomPlayerbotMgr::PrepareAddclassCache()
|
||||
LOG_INFO("playerbots", ">> {} characters collected for addclass command.", collected);
|
||||
}
|
||||
|
||||
void RandomPlayerbotMgr::Init()
|
||||
{
|
||||
if (sPlayerbotAIConfig->addClassCommand)
|
||||
sRandomPlayerbotMgr->PrepareAddclassCache();
|
||||
|
||||
if (sPlayerbotAIConfig->enabled)
|
||||
{
|
||||
sRandomPlayerbotMgr->PrepareTeleportCache();
|
||||
}
|
||||
|
||||
if (sPlayerbotAIConfig->randomBotJoinBG)
|
||||
sRandomPlayerbotMgr->LoadBattleMastersCache();
|
||||
|
||||
PlayerbotsDatabase.Execute("DELETE FROM playerbots_random_bots WHERE event = 'add'");
|
||||
}
|
||||
|
||||
void RandomPlayerbotMgr::RandomTeleportForLevel(Player* bot)
|
||||
{
|
||||
if (bot->InBattleground())
|
||||
|
||||
Reference in New Issue
Block a user