From 660fd2a0c1d4e9b69193ba28d41bf9b8986244a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E4=BD=A9=E8=8C=B9?= Date: Mon, 26 Sep 2022 11:09:57 -0600 Subject: [PATCH] Fix real guild check --- src/PlayerbotAI.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/PlayerbotAI.cpp b/src/PlayerbotAI.cpp index d4395a96..cd49bcc5 100644 --- a/src/PlayerbotAI.cpp +++ b/src/PlayerbotAI.cpp @@ -3517,9 +3517,13 @@ bool PlayerbotAI::IsInRealGuild() return false; Guild* guild = sGuildMgr->GetGuildById(bot->GetGuildId()); + if (!guild) + { + return false; + } uint32 leaderAccount = sCharacterCache->GetCharacterAccountIdByGuid(guild->GetLeaderGUID()); if (!leaderAccount) return false; - return sPlayerbotAIConfig->IsInRandomAccountList(leaderAccount); + return !(sPlayerbotAIConfig->IsInRandomAccountList(leaderAccount)); } \ No newline at end of file