Merge branch 'master' of github.com:liyunfan1223/mod-playerbots

This commit is contained in:
Yunfan Li
2024-01-04 19:55:19 +08:00
2 changed files with 28 additions and 32 deletions

View File

@@ -386,7 +386,7 @@ AiPlayerbot.AllowedLogFiles = ""
# WorldBuff.Faction.Class.MinLevel.MaxLevel
# Added following config
# Selfbot permission level (0 = disabled, 1 = gm only (default), 2 = all players, 3 = activate on login) # AiPlayerbot.SelfBotLevel = 1
# Selfbot permission level (0 = disabled, 1 = gm only (default), 2 = all players, 3 = activate on login)
AiPlayerbot.SelfBotLevel = 1
# Enables/Disables bot cheating

View File

@@ -364,7 +364,7 @@ Player* PlayerbotHolder::GetPlayerBot(ObjectGuid::LowType lowGuid) const
void PlayerbotHolder::OnBotLogin(Player* const bot)
{
sPlayerbotsMgr->AddPlayerbotData(bot, true);
OnBotLoginInternal(bot);
OnBotLoginInternal(bot);
playerBots[bot->GetGUID()] = bot;
@@ -632,11 +632,11 @@ std::string const PlayerbotHolder::ProcessBotCommand(std::string const cmd, Obje
bool PlayerbotMgr::HandlePlayerbotMgrCommand(ChatHandler* handler, char const* args)
{
if (!sPlayerbotAIConfig->enabled)
{
handler->PSendSysMessage("|cffff0000Playerbot system is currently disabled!");
if (!sPlayerbotAIConfig->enabled)
{
handler->PSendSysMessage("|cffff0000Playerbot system is currently disabled!");
return false;
}
}
WorldSession* m_session = handler->GetSession();
if (!m_session)
@@ -697,10 +697,6 @@ std::vector<std::string> PlayerbotHolder::HandlePlayerbotCommand(char const* arg
}
}
if (!strncmp(cmd, "initself=", 9)) {
if (!strcmp(cmd, "initself=rare")) {
if (master->GetSession()->GetSecurity() >= SEC_GAMEMASTER) {
@@ -792,8 +788,8 @@ std::vector<std::string> PlayerbotHolder::HandlePlayerbotCommand(char const* arg
if (!strcmp(cmd, "addclass"))
{
if (sPlayerbotAIConfig->addClassCommand == 0) {
messages.push_back("addclass command was disabled, please check your configuration");
if (sPlayerbotAIConfig->addClassCommand == 0 && master->GetSession()->GetSecurity() < SEC_GAMEMASTER) {
messages.push_back("You do not have permission to create bot by addclass command");
return messages;
}
if (!charname) {
@@ -914,14 +910,14 @@ std::vector<std::string> PlayerbotHolder::HandlePlayerbotCommand(char const* arg
Group::MemberSlotList slots = group->GetMemberSlots();
for (Group::member_citerator i = slots.begin(); i != slots.end(); i++)
{
ObjectGuid member = i->guid;
ObjectGuid member = i->guid;
if (member == master->GetGUID())
continue;
if (member == master->GetGUID())
continue;
std::string bot;
if (sCharacterCache->GetCharacterNameByGuid(member, bot))
bots.insert(bot);
std::string bot;
if (sCharacterCache->GetCharacterNameByGuid(member, bot))
bots.insert(bot);
}
}
@@ -957,7 +953,7 @@ std::vector<std::string> PlayerbotHolder::HandlePlayerbotCommand(char const* arg
bots.insert(charName);
} while (results->NextRow());
}
}
}
for (std::set<std::string>::iterator i = bots.begin(); i != bots.end(); ++i)
{