From 429bce30803aabb56f79e872d25653d06c6ac0b6 Mon Sep 17 00:00:00 2001 From: Oiuv Date: Sun, 31 Mar 2024 23:57:17 +0800 Subject: [PATCH] add config for another player's character as bot --- conf/playerbots.conf.dist | 3 +++ src/PlayerbotMgr.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index 9056aaf9..c65b06ed 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -17,6 +17,9 @@ AiPlayerbot.DeleteRandomBotAccounts = 0 # auto-login all player alts as bots on player login AiPlayerbot.BotAutologin = 0 +# Allow login other players' characters as bots +AiPlayerbot.allowPlayerBots = 0 + # Guild Task system AiPlayerbot.EnableGuildTasks = 0 diff --git a/src/PlayerbotMgr.cpp b/src/PlayerbotMgr.cpp index 4489a253..49dbf467 100644 --- a/src/PlayerbotMgr.cpp +++ b/src/PlayerbotMgr.cpp @@ -527,6 +527,9 @@ std::string const PlayerbotHolder::ProcessBotCommand(std::string const cmd, Obje if (ObjectAccessor::FindPlayer(guid)) return "player already logged in"; + if (!sPlayerbotAIConfig->allowPlayerBots && !isRandomAccount && !isMasterAccount) + return "You cannot login another player's character as bot."; + AddPlayerBot(guid, masterAccountId); return "ok"; }