mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
[Attack target] Fix a target selection bug that causing bot stuck
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include "RtiTargetValue.h"
|
#include "RtiTargetValue.h"
|
||||||
|
|
||||||
|
#include "AttackersValue.h"
|
||||||
#include "Playerbots.h"
|
#include "Playerbots.h"
|
||||||
#include "ServerFacade.h"
|
#include "ServerFacade.h"
|
||||||
|
|
||||||
@@ -61,7 +62,7 @@ Unit* RtiTargetValue::Calculate()
|
|||||||
//////////////////////////////////////////////////////end: delete below check
|
//////////////////////////////////////////////////////end: delete below check
|
||||||
|
|
||||||
Unit* unit = botAI->GetUnit(guid);
|
Unit* unit = botAI->GetUnit(guid);
|
||||||
if (!unit || unit->isDead() || !bot->IsWithinLOSInMap(unit) ||
|
if (!unit || unit->isDead() || !bot->IsWithinLOSInMap(unit) || !AttackersValue::IsValidTarget(unit, bot) ||
|
||||||
sServerFacade->IsDistanceGreaterThan(sServerFacade->GetDistance2d(bot, unit),
|
sServerFacade->IsDistanceGreaterThan(sServerFacade->GetDistance2d(bot, unit),
|
||||||
sPlayerbotAIConfig->sightDistance))
|
sPlayerbotAIConfig->sightDistance))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user