Code style

This commit is contained in:
Yunfan Li
2024-08-04 23:44:24 +08:00
parent fe94083a3f
commit de37cfd5aa
4 changed files with 45 additions and 28 deletions

View File

@@ -19,21 +19,27 @@ bool CheckMountStateAction::Execute(Event event)
bool enemy = AI_VALUE(Unit*, "enemy player target");
// ignore grind target in BG or bots will dismount near any creature (eg: the rams in AV)
bool dps = AI_VALUE(Unit*, "dps target");
bool fartarget = (enemy && sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "enemy player target"), 40.0f)) ||
bool fartarget =
(enemy && sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "enemy player target"), 40.0f)) ||
(dps && sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "dps target"), 50.0f));
bool attackdistance = false;
// bool chasedistance = false;
float attack_distance = 35.0f;
if (PlayerbotAI::IsMelee(bot)) {
if (PlayerbotAI::IsMelee(bot))
{
attack_distance = 5.0f;
} else {
}
else
{
attack_distance = 30.0f;
}
if (dps || enemy)
{
Unit* currentTarget = AI_VALUE(Unit*, "current target");
attackdistance = (enemy || dps) && currentTarget && sServerFacade->IsDistanceLessThan(AI_VALUE2(float, "distance", "current target"), attack_distance);
attackdistance =
(enemy || dps) && currentTarget &&
sServerFacade->IsDistanceLessThan(AI_VALUE2(float, "distance", "current target"), attack_distance);
}
if (bot->IsMounted() && attackdistance)