mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-20 15:39:25 +02:00
chore: Remove dead SearchForBestPath function and MaxMovementSearchTime config
This commit is contained in:
parent
9715c5d214
commit
bbef216838
@ -343,10 +343,6 @@ AiPlayerbot.MaxWaitForMove = 5000
|
||||
# 2 - MoveSplinePath disabled everywhere
|
||||
AiPlayerbot.DisableMoveSplinePath = 0
|
||||
|
||||
# Max search time for movement (higher for better movement on slopes)
|
||||
# Default: 3
|
||||
AiPlayerbot.MaxMovementSearchTime = 3
|
||||
|
||||
# Action expiration time
|
||||
AiPlayerbot.ExpireActionTime = 5000
|
||||
|
||||
|
||||
@ -1893,75 +1893,6 @@ PathResult MovementAction::GeneratePath(float x, float y, float z, uint32 accept
|
||||
return result;
|
||||
}
|
||||
|
||||
const Movement::PointsArray MovementAction::SearchForBestPath(float x, float y, float z, float& modified_z,
|
||||
int maxSearchCount, bool normal_only, float step)
|
||||
{
|
||||
bool found = false;
|
||||
modified_z = INVALID_HEIGHT;
|
||||
float tempZ = bot->GetMapHeight(x, y, z);
|
||||
PathGenerator gen(bot);
|
||||
gen.CalculatePath(x, y, tempZ);
|
||||
Movement::PointsArray result = gen.GetPath();
|
||||
float min_length = gen.getPathLength();
|
||||
int typeOk = PATHFIND_NORMAL | PATHFIND_INCOMPLETE;
|
||||
if ((gen.GetPathType() & typeOk) && abs(tempZ - z) < 0.5f)
|
||||
{
|
||||
modified_z = tempZ;
|
||||
return result;
|
||||
}
|
||||
// Start searching
|
||||
if (gen.GetPathType() & typeOk)
|
||||
{
|
||||
modified_z = tempZ;
|
||||
found = true;
|
||||
}
|
||||
int count = 1;
|
||||
for (float delta = step; count < maxSearchCount / 2 + 1; count++, delta += step)
|
||||
{
|
||||
tempZ = bot->GetMapHeight(x, y, z + delta);
|
||||
if (tempZ == INVALID_HEIGHT)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
PathGenerator gen(bot);
|
||||
gen.CalculatePath(x, y, tempZ);
|
||||
if ((gen.GetPathType() & typeOk) && gen.getPathLength() < min_length)
|
||||
{
|
||||
found = true;
|
||||
min_length = gen.getPathLength();
|
||||
result = gen.GetPath();
|
||||
modified_z = tempZ;
|
||||
}
|
||||
}
|
||||
for (float delta = -step; count < maxSearchCount; count++, delta -= step)
|
||||
{
|
||||
tempZ = bot->GetMapHeight(x, y, z + delta);
|
||||
if (tempZ == INVALID_HEIGHT)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
PathGenerator gen(bot);
|
||||
gen.CalculatePath(x, y, tempZ);
|
||||
if ((gen.GetPathType() & typeOk) && gen.getPathLength() < min_length)
|
||||
{
|
||||
found = true;
|
||||
min_length = gen.getPathLength();
|
||||
result = gen.GetPath();
|
||||
modified_z = tempZ;
|
||||
}
|
||||
}
|
||||
if (!found && normal_only)
|
||||
{
|
||||
modified_z = INVALID_HEIGHT;
|
||||
return Movement::PointsArray{};
|
||||
}
|
||||
if (!found && !normal_only)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void MovementAction::DoMovePoint(Unit* unit, float x, float y, float z, bool generatePath, bool backwards)
|
||||
{
|
||||
if (!unit)
|
||||
|
||||
@ -115,10 +115,6 @@ protected:
|
||||
};
|
||||
|
||||
private:
|
||||
// float SearchBestGroundZForPath(float x, float y, float z, bool generatePath, float range = 20.0f, bool
|
||||
// normal_only = false, float step = 8.0f);
|
||||
const Movement::PointsArray SearchForBestPath(float x, float y, float z, float& modified_z, int maxSearchCount = 5,
|
||||
bool normal_only = false, float step = 8.0f);
|
||||
bool wasMovementRestricted = false;
|
||||
void DoMovePoint(Unit* unit, float x, float y, float z, bool generatePath, bool backwards);
|
||||
};
|
||||
|
||||
@ -71,7 +71,6 @@ bool PlayerbotAIConfig::Initialize()
|
||||
globalCoolDown = sConfigMgr->GetOption<int32>("AiPlayerbot.GlobalCooldown", 500);
|
||||
maxWaitForMove = sConfigMgr->GetOption<int32>("AiPlayerbot.MaxWaitForMove", 5000);
|
||||
disableMoveSplinePath = sConfigMgr->GetOption<int32>("AiPlayerbot.DisableMoveSplinePath", 0);
|
||||
maxMovementSearchTime = sConfigMgr->GetOption<int32>("AiPlayerbot.MaxMovementSearchTime", 3);
|
||||
expireActionTime = sConfigMgr->GetOption<int32>("AiPlayerbot.ExpireActionTime", 5000);
|
||||
dispelAuraDuration = sConfigMgr->GetOption<int32>("AiPlayerbot.DispelAuraDuration", 700);
|
||||
reactDelay = sConfigMgr->GetOption<int32>("AiPlayerbot.ReactDelay", 100);
|
||||
|
||||
@ -84,7 +84,7 @@ public:
|
||||
bool EnableICCBuffs;
|
||||
bool allowAccountBots, allowGuildBots, allowTrustedAccountBots;
|
||||
bool randomBotGuildNearby, randomBotInvitePlayer, inviteChat;
|
||||
uint32 globalCoolDown, reactDelay, maxWaitForMove, disableMoveSplinePath, maxMovementSearchTime, expireActionTime,
|
||||
uint32 globalCoolDown, reactDelay, maxWaitForMove, disableMoveSplinePath, expireActionTime,
|
||||
dispelAuraDuration, passiveDelay, repeatDelay, errorDelay, rpgDelay, sitDelay, returnDelay, lootDelay;
|
||||
bool dynamicReactDelay;
|
||||
float sightDistance, spellDistance, reactDistance, grindDistance, lootDistance, shootDistance, fleeDistance,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user