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 (ref && ref->getTarget() == bot) // bot is target - try to flee to tank or master
|
||||||
{
|
{
|
||||||
if (Group* group = bot->GetGroup())
|
if (Group* group = bot->GetGroup())
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ bool HasAggroValue::Calculate()
|
|||||||
ref = ref->next();
|
ref = ref->next();
|
||||||
}
|
}
|
||||||
|
|
||||||
ref = target->getThreatMgr().getCurrentVictim();
|
ref = target->GetThreatMgr().getCurrentVictim();
|
||||||
if (ref)
|
if (ref)
|
||||||
{
|
{
|
||||||
if (Unit* victim = ref->getTarget())
|
if (Unit* victim = ref->getTarget())
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ void AttackersValue::AddAttackersOf(Player* player, std::set<Unit*>& targets)
|
|||||||
{
|
{
|
||||||
if (!player->GetGroup())
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ bool AttackersValue::IsPossibleTarget(Unit* attacker, Player* bot, float range)
|
|||||||
|
|
||||||
bool leaderHasThreat = false;
|
bool leaderHasThreat = false;
|
||||||
if (attacker && bot->GetGroup() && botAI->GetMaster())
|
if (attacker && bot->GetGroup() && botAI->GetMaster())
|
||||||
leaderHasThreat = attacker->getThreatMgr().getThreat(botAI->GetMaster());
|
leaderHasThreat = attacker->GetThreatMgr().getThreat(botAI->GetMaster());
|
||||||
|
|
||||||
bool isMemberBotGroup = false;
|
bool isMemberBotGroup = false;
|
||||||
if (bot->GetGroup() && botAI->GetMaster())
|
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)
|
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());
|
attacker->GetGUID().IsPlayer() || attacker->GetGUID() == GET_PLAYERBOT_AI(bot)->GetAiObjectContext()->GetValue<ObjectGuid>("pull target")->Get());
|
||||||
}
|
}
|
||||||
bool PossibleAddsValue::Calculate()
|
bool PossibleAddsValue::Calculate()
|
||||||
@@ -146,7 +146,7 @@ bool PossibleAddsValue::Calculate()
|
|||||||
|
|
||||||
if (Unit* add = botAI->GetUnit(guid))
|
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)
|
for (ObjectGuid const attackerGUID : attackers)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ Unit* TargetValue::FindTarget(FindTargetStrategy* strategy)
|
|||||||
if (!unit)
|
if (!unit)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ThreatMgr &ThreatMgr = unit->getThreatMgr();
|
ThreatMgr &ThreatMgr = unit->GetThreatMgr();
|
||||||
strategy->CheckAttacker(unit, &ThreatMgr);
|
strategy->CheckAttacker(unit, &ThreatMgr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ uint8 ThreatValue::Calculate(Unit* target)
|
|||||||
if (!group)
|
if (!group)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
float botThreat = target->getThreatMgr().getThreat(bot);
|
float botThreat = target->GetThreatMgr().getThreat(bot);
|
||||||
float maxThreat = -1.0f;
|
float maxThreat = -1.0f;
|
||||||
bool hasTank = false;
|
bool hasTank = false;
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ uint8 ThreatValue::Calculate(Unit* target)
|
|||||||
if (botAI->IsTank(player))
|
if (botAI->IsTank(player))
|
||||||
{
|
{
|
||||||
hasTank = true;
|
hasTank = true;
|
||||||
float threat = target->getThreatMgr().getThreat(player);
|
float threat = target->GetThreatMgr().getThreat(player);
|
||||||
if (maxThreat < threat)
|
if (maxThreat < threat)
|
||||||
maxThreat = threat;
|
maxThreat = threat;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user