[Bots] Move BotGetSpellsByType to cache (#4655)

This commit is contained in:
nytmyr
2025-02-07 13:05:36 -06:00
committed by GitHub
parent e0d95b4302
commit ed7023f336
4 changed files with 29 additions and 28 deletions
+1 -8
View File
@@ -134,14 +134,7 @@ void bot_command_discipline(Client* c, const Seperator* sep)
}
if (spell_id == UINT16_MAX) { // Aggressive/Defensive type
std::vector<BotSpells_wIndex> bot_spell_list;
if (aggressive) {
bot_spell_list = bot_iter->BotGetSpellsByType(BotSpellTypes::DiscAggressive);
}
else if (defensive) {
bot_spell_list = bot_iter->BotGetSpellsByType(BotSpellTypes::DiscDefensive);
}
const std::vector<BotSpells_wIndex>& bot_spell_list = bot_iter->BotGetSpellsByType(aggressive ? BotSpellTypes::DiscAggressive : BotSpellTypes::DiscDefensive);
for (int i = bot_spell_list.size() - 1; i >= 0; i--) {
if (!IsValidSpell(bot_spell_list[i].spellid)) {