diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index 7e94f9f90..5f8b8aba4 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -390,14 +390,6 @@ AiPlayerbot.AggroDistance = 22 AiPlayerbot.TooCloseDistance = 5.0 AiPlayerbot.MeleeDistance = 0.75 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.ContactDistance = 0.45 AiPlayerbot.AoeRadius = 10 diff --git a/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp b/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp index aa37471f0..153d99e9d 100644 --- a/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp +++ b/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp @@ -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; - 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() && - bot->GetExactDist2d(master) < sPlayerbotAIConfig.walkDistance) - { - moveMode = FORCED_MOVEMENT_WALK; - } + moveMode = FORCED_MOVEMENT_WALK; } } diff --git a/src/PlayerbotAIConfig.cpp b/src/PlayerbotAIConfig.cpp index 4f8dbdb9a..5e6932171 100644 --- a/src/PlayerbotAIConfig.cpp +++ b/src/PlayerbotAIConfig.cpp @@ -97,7 +97,6 @@ bool PlayerbotAIConfig::Initialize() tooCloseDistance = sConfigMgr->GetOption("AiPlayerbot.TooCloseDistance", 5.0f); meleeDistance = sConfigMgr->GetOption("AiPlayerbot.MeleeDistance", 0.75f); followDistance = sConfigMgr->GetOption("AiPlayerbot.FollowDistance", 1.5f); - walkDistance = sConfigMgr->GetOption("AiPlayerbot.WalkDistance", 5.0f); whisperDistance = sConfigMgr->GetOption("AiPlayerbot.WhisperDistance", 6000.0f); contactDistance = sConfigMgr->GetOption("AiPlayerbot.ContactDistance", 0.45f); aoeRadius = sConfigMgr->GetOption("AiPlayerbot.AoeRadius", 10.0f); diff --git a/src/PlayerbotAIConfig.h b/src/PlayerbotAIConfig.h index 4f3de8d90..1611f9b30 100644 --- a/src/PlayerbotAIConfig.h +++ b/src/PlayerbotAIConfig.h @@ -96,7 +96,7 @@ public: bool dynamicReactDelay; float sightDistance, spellDistance, reactDistance, grindDistance, lootDistance, shootDistance, fleeDistance, tooCloseDistance, meleeDistance, followDistance, whisperDistance, contactDistance, aoeRadius, rpgDistance, - targetPosRecalcDistance, farDistance, healDistance, aggroDistance, walkDistance; + targetPosRecalcDistance, farDistance, healDistance, aggroDistance; uint32 criticalHealth, lowHealth, mediumHealth, almostFullHealth; uint32 lowMana, mediumMana, highMana; bool autoSaveMana;