Improve ICC spread and fix Valithria trigger (#884)

* Temp fix valithria find target

* Improve spread with FleePosition

* Fix Valithria trigger
This commit is contained in:
Yunfan Li
2025-01-22 03:24:06 +08:00
committed by GitHub
parent b0ca0e8595
commit f6cc3f6e40
4 changed files with 28 additions and 15 deletions

View File

@@ -2144,8 +2144,13 @@ Position MovementAction::BestPositionForRangedToFlee(Position pos, float radius)
return Position();
}
bool MovementAction::FleePosition(Position pos, float radius)
bool MovementAction::FleePosition(Position pos, float radius, uint32 minInterval)
{
std::list<FleeInfo>& infoList = AI_VALUE(std::list<FleeInfo>&, "recently flee info");
if (!infoList.empty() && infoList.back().timestamp + minInterval > getMSTime())
return false;
Position bestPos;
if (botAI->IsMelee(bot))
{
@@ -2160,7 +2165,6 @@ bool MovementAction::FleePosition(Position pos, float radius)
if (MoveTo(bot->GetMapId(), bestPos.GetPositionX(), bestPos.GetPositionY(), bestPos.GetPositionZ(), false,
false, true, false, MovementPriority::MOVEMENT_COMBAT))
{
std::list<FleeInfo>& infoList = AI_VALUE(std::list<FleeInfo>&, "recently flee info");
uint32 curTS = getMSTime();
while (!infoList.empty())
{