Skip to content

Commit f926c74

Browse files
authored
Fix to melee dead-zone (#275)
1 parent 46f8d75 commit f926c74

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/modules/Bots/playerbot/strategy/actions/AttackAction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ bool AttackAction::Attack(Unit* target)
5757
if (verbose)
5858
{
5959
ai->TellMaster("I have no target");
60-
return false;
6160
}
61+
return false;
6262
}
6363

6464
ostringstream msg;

src/modules/Bots/playerbot/strategy/actions/ReachTargetActions.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ namespace ai
4747
{
4848
public:
4949
ReachMeleeAction(PlayerbotAI* ai) : ReachTargetAction(ai, "reach melee", sPlayerbotAIConfig.meleeDistance) {}
50+
51+
virtual bool isUseful()
52+
{
53+
return AI_VALUE2(float, "distance", "current target") > distance + sPlayerbotAIConfig.contactDistance + bot->GetObjectBoundingRadius();
54+
}
5055
};
5156

5257
class ReachSpellAction : public ReachTargetAction

0 commit comments

Comments
 (0)