mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Allow addclass bots that are not in a real guild (#970)
This commit is contained in:
@@ -5346,12 +5346,9 @@ bool PlayerbotAI::CanMove()
|
|||||||
return bot->GetMotionMaster()->GetCurrentMovementGeneratorType() != FLIGHT_MOTION_TYPE;
|
return bot->GetMotionMaster()->GetCurrentMovementGeneratorType() != FLIGHT_MOTION_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PlayerbotAI::IsInRealGuild()
|
bool PlayerbotAI::IsRealGuild(uint32 guildId)
|
||||||
{
|
{
|
||||||
if (!bot->GetGuildId())
|
Guild* guild = sGuildMgr->GetGuildById(guildId);
|
||||||
return false;
|
|
||||||
|
|
||||||
Guild* guild = sGuildMgr->GetGuildById(bot->GetGuildId());
|
|
||||||
if (!guild)
|
if (!guild)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@@ -5363,6 +5360,14 @@ bool PlayerbotAI::IsInRealGuild()
|
|||||||
return !(sPlayerbotAIConfig->IsInRandomAccountList(leaderAccount));
|
return !(sPlayerbotAIConfig->IsInRandomAccountList(leaderAccount));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PlayerbotAI::IsInRealGuild()
|
||||||
|
{
|
||||||
|
if (!bot->GetGuildId())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return IsRealGuild(bot->GetGuildId());
|
||||||
|
}
|
||||||
|
|
||||||
void PlayerbotAI::QueueChatResponse(const ChatQueuedReply chatReply) { chatReplies.push_back(std::move(chatReply)); }
|
void PlayerbotAI::QueueChatResponse(const ChatQueuedReply chatReply) { chatReplies.push_back(std::move(chatReply)); }
|
||||||
|
|
||||||
bool PlayerbotAI::EqualLowercaseName(std::string s1, std::string s2)
|
bool PlayerbotAI::EqualLowercaseName(std::string s1, std::string s2)
|
||||||
|
|||||||
@@ -556,6 +556,7 @@ public:
|
|||||||
void ResetJumpDestination() { jumpDestination = Position(); }
|
void ResetJumpDestination() { jumpDestination = Position(); }
|
||||||
|
|
||||||
bool CanMove();
|
bool CanMove();
|
||||||
|
static bool IsRealGuild(uint32 guildId);
|
||||||
bool IsInRealGuild();
|
bool IsInRealGuild();
|
||||||
static std::vector<std::string> dispel_whitelist;
|
static std::vector<std::string> dispel_whitelist;
|
||||||
bool EqualLowercaseName(std::string s1, std::string s2);
|
bool EqualLowercaseName(std::string s1, std::string s2);
|
||||||
|
|||||||
@@ -1055,7 +1055,8 @@ std::vector<std::string> PlayerbotHolder::HandlePlayerbotCommand(char const* arg
|
|||||||
continue;
|
continue;
|
||||||
if (ObjectAccessor::FindConnectedPlayer(guid))
|
if (ObjectAccessor::FindConnectedPlayer(guid))
|
||||||
continue;
|
continue;
|
||||||
if (sCharacterCache->GetCharacterGuildIdByGuid(guid))
|
uint32 guildId = sCharacterCache->GetCharacterGuildIdByGuid(guid);
|
||||||
|
if (guildId && PlayerbotAI::IsRealGuild(guildId))
|
||||||
continue;
|
continue;
|
||||||
AddPlayerBot(guid, master->GetSession()->GetAccountId());
|
AddPlayerBot(guid, master->GetSession()->GetAccountId());
|
||||||
messages.push_back("Add class " + std::string(charname));
|
messages.push_back("Add class " + std::string(charname));
|
||||||
|
|||||||
Reference in New Issue
Block a user