mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Compile bug fixes.
This commit is contained in:
@@ -1048,7 +1048,7 @@ bool MovementAction::Flee(Unit *target)
|
||||
}
|
||||
}
|
||||
|
||||
HostileReference* ref = target->getThreatMgr().getCurrentVictim();
|
||||
HostileReference* ref = target->GetThreatMgr().getCurrentVictim();
|
||||
if (ref && ref->getTarget() == bot) // bot is target - try to flee to tank or master
|
||||
{
|
||||
if (Group* group = bot->GetGroup())
|
||||
|
||||
@@ -31,7 +31,7 @@ bool HasAggroValue::Calculate()
|
||||
ref = ref->next();
|
||||
}
|
||||
|
||||
ref = target->getThreatMgr().getCurrentVictim();
|
||||
ref = target->GetThreatMgr().getCurrentVictim();
|
||||
if (ref)
|
||||
{
|
||||
if (Unit* victim = ref->getTarget())
|
||||
|
||||
@@ -72,7 +72,7 @@ void AttackersValue::AddAttackersOf(Player* player, std::set<Unit*>& targets)
|
||||
{
|
||||
if (!player->GetGroup())
|
||||
{
|
||||
if (!unit->getThreatMgr().getThreat(player) && (!unit->getThreatMgr().getCurrentVictim() || unit->getThreatMgr().getCurrentVictim()->getTarget() != player))
|
||||
if (!unit->GetThreatMgr().getThreat(player) && (!unit->GetThreatMgr().getCurrentVictim() || unit->GetThreatMgr().getCurrentVictim()->getTarget() != player))
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ bool AttackersValue::IsPossibleTarget(Unit* attacker, Player* bot, float range)
|
||||
|
||||
bool leaderHasThreat = false;
|
||||
if (attacker && bot->GetGroup() && botAI->GetMaster())
|
||||
leaderHasThreat = attacker->getThreatMgr().getThreat(botAI->GetMaster());
|
||||
leaderHasThreat = attacker->GetThreatMgr().getThreat(botAI->GetMaster());
|
||||
|
||||
bool isMemberBotGroup = false;
|
||||
if (bot->GetGroup() && botAI->GetMaster())
|
||||
@@ -131,7 +131,7 @@ bool AttackersValue::IsPossibleTarget(Unit* attacker, Player* bot, float range)
|
||||
|
||||
bool AttackersValue::IsValidTarget(Unit *attacker, Player *bot)
|
||||
{
|
||||
return IsPossibleTarget(attacker, bot) && (attacker->getThreatMgr().getCurrentVictim() || attacker->GetGuidValue(UNIT_FIELD_TARGET) ||
|
||||
return IsPossibleTarget(attacker, bot) && (attacker->GetThreatMgr().getCurrentVictim() || attacker->GetGuidValue(UNIT_FIELD_TARGET) ||
|
||||
attacker->GetGUID().IsPlayer() || attacker->GetGUID() == GET_PLAYERBOT_AI(bot)->GetAiObjectContext()->GetValue<ObjectGuid>("pull target")->Get());
|
||||
}
|
||||
bool PossibleAddsValue::Calculate()
|
||||
@@ -146,7 +146,7 @@ bool PossibleAddsValue::Calculate()
|
||||
|
||||
if (Unit* add = botAI->GetUnit(guid))
|
||||
{
|
||||
if (!add->GetTarget() && !add->getThreatMgr().getCurrentVictim() && add->IsHostileTo(bot))
|
||||
if (!add->GetTarget() && !add->GetThreatMgr().getCurrentVictim() && add->IsHostileTo(bot))
|
||||
{
|
||||
for (ObjectGuid const attackerGUID : attackers)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ Unit* TargetValue::FindTarget(FindTargetStrategy* strategy)
|
||||
if (!unit)
|
||||
continue;
|
||||
|
||||
ThreatMgr &ThreatMgr = unit->getThreatMgr();
|
||||
ThreatMgr &ThreatMgr = unit->GetThreatMgr();
|
||||
strategy->CheckAttacker(unit, &ThreatMgr);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ uint8 ThreatValue::Calculate(Unit* target)
|
||||
if (!group)
|
||||
return 0;
|
||||
|
||||
float botThreat = target->getThreatMgr().getThreat(bot);
|
||||
float botThreat = target->GetThreatMgr().getThreat(bot);
|
||||
float maxThreat = -1.0f;
|
||||
bool hasTank = false;
|
||||
|
||||
@@ -55,7 +55,7 @@ uint8 ThreatValue::Calculate(Unit* target)
|
||||
if (botAI->IsTank(player))
|
||||
{
|
||||
hasTank = true;
|
||||
float threat = target->getThreatMgr().getThreat(player);
|
||||
float threat = target->GetThreatMgr().getThreat(player);
|
||||
if (maxThreat < threat)
|
||||
maxThreat = threat;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user