Merge branch 'liyunfan1223:master' into master

This commit is contained in:
Atidote
2024-08-05 16:23:19 +02:00
committed by GitHub
16 changed files with 184 additions and 107 deletions

View File

@@ -30,6 +30,7 @@
#include "ObjectGuid.h"
#include "PerformanceMonitor.h"
#include "Player.h"
#include "PlayerbotAIConfig.h"
#include "PlayerbotDbStore.h"
#include "PlayerbotMgr.h"
#include "Playerbots.h"
@@ -342,10 +343,11 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal)
UpdateAIInternal(elapsed, min);
inCombat = bot->IsInCombat();
// test fix lags because of BG
bool inBG = bot->InBattleground() || bot->InArena();
if (bot && !inCombat)
min = true;
if (HasRealPlayerMaster())
if (HasRealPlayerMaster() || (sPlayerbotAIConfig->fastReactInBG && inBG))
min = false;
YieldThread(min);
@@ -1629,7 +1631,7 @@ bool PlayerbotAI::IsCaster(Player* player) { return IsRanged(player) && player->
bool PlayerbotAI::IsCombo(Player* player)
{
int tab = AiFactory::GetPlayerSpecTab(player);
// int tab = AiFactory::GetPlayerSpecTab(player);
return player->getClass() == CLASS_ROGUE ||
(player->getClass() == CLASS_DRUID && player->HasAura(768)); // cat druid
}
@@ -3020,8 +3022,8 @@ bool PlayerbotAI::CastSpell(uint32 spellId, Unit* target, Item* itemTarget)
return true;
}
aiObjectContext->GetValue<LastMovement&>("last movement")->Get().Set(nullptr);
aiObjectContext->GetValue<time_t>("stay time")->Set(0);
// aiObjectContext->GetValue<LastMovement&>("last movement")->Get().Set(nullptr);
// aiObjectContext->GetValue<time_t>("stay time")->Set(0);
if (bot->IsFlying() || bot->HasUnitState(UNIT_STATE_IN_FLIGHT))
{
@@ -3206,8 +3208,8 @@ bool PlayerbotAI::CastSpell(uint32 spellId, float x, float y, float z, Item* ite
return true;
}
aiObjectContext->GetValue<LastMovement&>("last movement")->Get().Set(nullptr);
aiObjectContext->GetValue<time_t>("stay time")->Set(0);
// aiObjectContext->GetValue<LastMovement&>("last movement")->Get().Set(nullptr);
// aiObjectContext->GetValue<time_t>("stay time")->Set(0);
MotionMaster& mm = *bot->GetMotionMaster();