Allow bots to bypass los checks for positioning if no detrimental types allowed

This commit is contained in:
nytmyr
2024-11-28 22:15:02 -06:00
parent d0033d4786
commit ceeb083864
3 changed files with 47 additions and 13 deletions
+7 -13
View File
@@ -11329,14 +11329,14 @@ bool Bot::RequiresLoSForPositioning() {
if (GetLevel() < GetStopMeleeLevel()) {
return true;
}
else if (GetClass() == Class::Bard) {
return false;
}
else if (GetClass() == Class::Cleric) { //TODO bot rewrite - add check to see if spell requires los
return false;
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; ++i) {
if (BOT_SPELL_TYPES_DETRIMENTAL(i) && !GetSpellHold(i)) {
return true;
}
}
return true;
return false;
}
bool Bot::HasRequiredLoSForPositioning(Mob* tar) {
@@ -11344,13 +11344,7 @@ bool Bot::HasRequiredLoSForPositioning(Mob* tar) {
return true;
}
if (GetClass() == Class::Cleric) { //add check to see if spell requires los
return true;
}
else if (GetClass() == Class::Bard && GetLevel() >= GetStopMeleeLevel()) {
return true;
}
if (!DoLosChecks(this, tar)) {
if (RequiresLoSForPositioning() && !DoLosChecks(this, tar)) {
return false;
}