Tweak automation

This commit is contained in:
郑佩茹
2022-09-22 17:22:19 -06:00
parent 1e490e80e4
commit 88d81c7a31
4 changed files with 31 additions and 3 deletions

View File

@@ -27,6 +27,9 @@ bool LeaveLargeGuildTrigger::IsActive()
if (botAI->IsAlt())
return false;
if (botAI->IsInRealGuild())
return false;
GuilderType type = botAI->GetGuilderType();
Guild* guild = sGuildMgr->GetGuildById(bot->GetGuildId());
@@ -34,7 +37,7 @@ bool LeaveLargeGuildTrigger::IsActive()
Player* leader = ObjectAccessor::FindPlayer(guild->GetLeaderGUID());
//Only leave the guild if we know the leader is not a real player.
if (!leader)
if (!leader || !GET_PLAYERBOT_AI(leader) || !GET_PLAYERBOT_AI(leader)->IsRealPlayer())
return false;
PlayerbotAI* leaderBotAI = GET_PLAYERBOT_AI(leader);