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 "AttackersValue.h"
|
||||
#include "Playerbots.h"
|
||||
#include "ServerFacade.h"
|
||||
|
||||
@@ -61,7 +62,7 @@ Unit* RtiTargetValue::Calculate()
|
||||
//////////////////////////////////////////////////////end: delete below check
|
||||
|
||||
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),
|
||||
sPlayerbotAIConfig->sightDistance))
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user