feat: fix initialization

This commit is contained in:
Yunfan Li
2023-05-27 13:59:37 +08:00
parent 149941403c
commit 5d570a81a0
5 changed files with 192 additions and 98 deletions

View File

@@ -79,20 +79,20 @@ bool CheckMountStateAction::Execute(Event event)
return Mount();
}
if (!bot->InBattleground())
{
if (AI_VALUE(GuidPosition, "rpg target"))
{
if (sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "rpg target"), sPlayerbotAIConfig->farDistance) && noattackers && !dps && !enemy)
return Mount();
}
// if (!bot->InBattleground())
// {
// if (AI_VALUE(GuidPosition, "rpg target"))
// {
// if (sServerFacade->IsDistanceGreaterThan(AI_VALUE2(float, "distance", "rpg target"), sPlayerbotAIConfig->farDistance) && noattackers && !dps && !enemy)
// return Mount();
// }
if (((!AI_VALUE(GuidVector, "possible rpg targets").empty()) && noattackers && !dps && !enemy) && urand(0, 100) > 50)
return Mount();
}
// if (((!AI_VALUE(GuidVector, "possible rpg targets").empty()) && noattackers && !dps && !enemy) && urand(0, 100) > 50)
// return Mount();
// }
if (!bot->IsMounted() && !attackdistance && (fartarget || chasedistance))
return Mount();
// if (!bot->IsMounted() && !attackdistance && (fartarget || chasedistance))
// return Mount();
if (!bot->IsFlying() && attackdistance && bot->IsMounted() && (enemy || dps || (!noattackers && bot->IsInCombat())))
{