mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 07:18:37 +00:00
[Bots] Fix spell priority commands (#4660)
- Fix priority value check in spellpriority commands - Fix list option - Remove unnecessary temp vector on list grab - Will move getter to cache in future PR
This commit is contained in:
+3
-10
@@ -11174,25 +11174,18 @@ void Bot::SetSpellTypePriority(uint16 spell_type, uint8 priority_type, uint16 pr
|
||||
|
||||
std::list<BotSpellTypeOrder> Bot::GetSpellTypesPrioritized(uint8 priority_type) {
|
||||
std::list<BotSpellTypeOrder> cast_order;
|
||||
std::list<BotSpellTypeOrder> temp_cast_order;
|
||||
|
||||
|
||||
for (uint16 i = BotSpellTypes::START; i <= BotSpellTypes::END; i++) {
|
||||
BotSpellTypeOrder typeSettings = {
|
||||
.spellType = i,
|
||||
.priority = GetSpellTypePriority(i, priority_type)
|
||||
};
|
||||
|
||||
cast_order.emplace_back(typeSettings);
|
||||
}
|
||||
|
||||
for (auto& currentType : cast_order) {
|
||||
if (currentType.priority != 0) {
|
||||
temp_cast_order.emplace_back(currentType);
|
||||
if (typeSettings.priority != 0) {
|
||||
cast_order.emplace_back(typeSettings);
|
||||
}
|
||||
}
|
||||
|
||||
cast_order = temp_cast_order;
|
||||
|
||||
if (cast_order.size() > 1) {
|
||||
cast_order.sort(
|
||||
[](BotSpellTypeOrder const& l, BotSpellTypeOrder const& r) {
|
||||
|
||||
Reference in New Issue
Block a user