mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08: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);
|
||||
}
|
||||
@@ -366,6 +366,7 @@ class PlayerbotAI : public PlayerbotAIBase
|
||||
void ResetJumpDestination() { jumpDestination = Position(); }
|
||||
|
||||
bool CanMove();
|
||||
bool IsInRealGuild();
|
||||
|
||||
private:
|
||||
void _fillGearScoreData(Player* player, Item* item, std::vector<uint32>* gearScore, uint32& twoHandScore);
|
||||
|
||||
@@ -50,10 +50,7 @@ bool PlayerbotAIBase::CanUpdateAI()
|
||||
void PlayerbotAIBase::YieldThread(bool delay)
|
||||
{
|
||||
if (nextAICheckDelay < sPlayerbotAIConfig->reactDelay)
|
||||
nextAICheckDelay = sPlayerbotAIConfig->reactDelay;
|
||||
|
||||
if (delay && nextAICheckDelay <= sPlayerbotAIConfig->reactDelay * 10)
|
||||
nextAICheckDelay = sPlayerbotAIConfig->reactDelay * 10;
|
||||
nextAICheckDelay = delay ? sPlayerbotAIConfig->reactDelay * 10 : sPlayerbotAIConfig->reactDelay;
|
||||
}
|
||||
|
||||
bool PlayerbotAIBase::IsActive()
|
||||
|
||||
Reference in New Issue
Block a user