refactor(Conf): Hardcode master-walk-pace distance to 5y, drop config

This commit is contained in:
bash 2026-05-30 20:29:01 +02:00
parent ecbf3fdec2
commit 7278a3bfcb
4 changed files with 6 additions and 18 deletions

View File

@ -390,14 +390,6 @@ AiPlayerbot.AggroDistance = 22
AiPlayerbot.TooCloseDistance = 5.0 AiPlayerbot.TooCloseDistance = 5.0
AiPlayerbot.MeleeDistance = 0.75 AiPlayerbot.MeleeDistance = 0.75
AiPlayerbot.FollowDistance = 1.5 AiPlayerbot.FollowDistance = 1.5
#
# WalkDistance
# Description: When the master is walking and within this many yards
# of the bot, the bot matches their walk pace instead of
# running. Set to 0 to disable pace-matching.
# Default: 5.0
#
AiPlayerbot.WalkDistance = 5.0
AiPlayerbot.WhisperDistance = 6000.0 AiPlayerbot.WhisperDistance = 6000.0
AiPlayerbot.ContactDistance = 0.45 AiPlayerbot.ContactDistance = 0.45
AiPlayerbot.AoeRadius = 10 AiPlayerbot.AoeRadius = 10

View File

@ -375,17 +375,14 @@ bool NewRpgBaseAction::DispatchPathPoints(WorldPosition const& dest,
} }
} }
// Match master's walk pace when they're nearby and walking. // Match master's walk pace when they're walking and within 5y.
ForcedMovement moveMode = FORCED_MOVEMENT_RUN; ForcedMovement moveMode = FORCED_MOVEMENT_RUN;
if (sPlayerbotAIConfig.walkDistance > 0.0f) if (Player* master = botAI->GetMaster())
{ {
if (Player* master = botAI->GetMaster()) if (bot->IsFriendlyTo(master) && master->IsWalking() &&
bot->GetExactDist2d(master) < 5.0f)
{ {
if (bot->IsFriendlyTo(master) && master->IsWalking() && moveMode = FORCED_MOVEMENT_WALK;
bot->GetExactDist2d(master) < sPlayerbotAIConfig.walkDistance)
{
moveMode = FORCED_MOVEMENT_WALK;
}
} }
} }

View File

@ -97,7 +97,6 @@ bool PlayerbotAIConfig::Initialize()
tooCloseDistance = sConfigMgr->GetOption<float>("AiPlayerbot.TooCloseDistance", 5.0f); tooCloseDistance = sConfigMgr->GetOption<float>("AiPlayerbot.TooCloseDistance", 5.0f);
meleeDistance = sConfigMgr->GetOption<float>("AiPlayerbot.MeleeDistance", 0.75f); meleeDistance = sConfigMgr->GetOption<float>("AiPlayerbot.MeleeDistance", 0.75f);
followDistance = sConfigMgr->GetOption<float>("AiPlayerbot.FollowDistance", 1.5f); followDistance = sConfigMgr->GetOption<float>("AiPlayerbot.FollowDistance", 1.5f);
walkDistance = sConfigMgr->GetOption<float>("AiPlayerbot.WalkDistance", 5.0f);
whisperDistance = sConfigMgr->GetOption<float>("AiPlayerbot.WhisperDistance", 6000.0f); whisperDistance = sConfigMgr->GetOption<float>("AiPlayerbot.WhisperDistance", 6000.0f);
contactDistance = sConfigMgr->GetOption<float>("AiPlayerbot.ContactDistance", 0.45f); contactDistance = sConfigMgr->GetOption<float>("AiPlayerbot.ContactDistance", 0.45f);
aoeRadius = sConfigMgr->GetOption<float>("AiPlayerbot.AoeRadius", 10.0f); aoeRadius = sConfigMgr->GetOption<float>("AiPlayerbot.AoeRadius", 10.0f);

View File

@ -96,7 +96,7 @@ public:
bool dynamicReactDelay; bool dynamicReactDelay;
float sightDistance, spellDistance, reactDistance, grindDistance, lootDistance, shootDistance, fleeDistance, float sightDistance, spellDistance, reactDistance, grindDistance, lootDistance, shootDistance, fleeDistance,
tooCloseDistance, meleeDistance, followDistance, whisperDistance, contactDistance, aoeRadius, rpgDistance, tooCloseDistance, meleeDistance, followDistance, whisperDistance, contactDistance, aoeRadius, rpgDistance,
targetPosRecalcDistance, farDistance, healDistance, aggroDistance, walkDistance; targetPosRecalcDistance, farDistance, healDistance, aggroDistance;
uint32 criticalHealth, lowHealth, mediumHealth, almostFullHealth; uint32 criticalHealth, lowHealth, mediumHealth, almostFullHealth;
uint32 lowMana, mediumMana, highMana; uint32 lowMana, mediumMana, highMana;
bool autoSaveMana; bool autoSaveMana;