mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-13 09:07:19 +00:00
Is in real guild function
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "UpdateTime.h"
|
||||
#include "Vehicle.h"
|
||||
#include "GuildMgr.h"
|
||||
|
||||
std::vector<std::string>& split(std::string const s, char delim, std::vector<std::string>& elems);
|
||||
std::vector<std::string> split(std::string const s, char delim);
|
||||
@@ -241,8 +242,6 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal)
|
||||
}
|
||||
|
||||
bool min = minimal;
|
||||
if (HasRealPlayerMaster())
|
||||
min = false;
|
||||
|
||||
UpdateAIInternal(elapsed, min);
|
||||
|
||||
@@ -250,6 +249,9 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal)
|
||||
if (bot && !inCombat)
|
||||
min = true;
|
||||
|
||||
if (HasRealPlayerMaster())
|
||||
min = false;
|
||||
|
||||
YieldThread(min);
|
||||
}
|
||||
|
||||
@@ -3508,3 +3510,16 @@ bool PlayerbotAI::CanMove()
|
||||
|
||||
return bot->GetMotionMaster()->GetCurrentMovementGeneratorType() != FLIGHT_MOTION_TYPE;
|
||||
}
|
||||
|
||||
bool PlayerbotAI::IsInRealGuild()
|
||||
{
|
||||
if (!bot->GetGuildId())
|
||||
return false;
|
||||
|
||||
Guild* guild = sGuildMgr->GetGuildById(bot->GetGuildId());
|
||||
uint32 leaderAccount = sCharacterCache->GetCharacterAccountIdByGuid(guild->GetLeaderGUID());
|
||||
if (!leaderAccount)
|
||||
return false;
|
||||
|
||||
return sPlayerbotAIConfig->IsInRandomAccountList(leaderAccount);
|
||||
}
|
||||
Reference in New Issue
Block a user