mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-09 22:20:24 +00:00
[Quest API] Add GetBotListByClientName() Class Overload to Perl/Lua. (#2577)
# Perl - Add `$entity_list->GetBotListByClientName(client_name, class_id)`. # Lua - Add `eq.get_entity_list():GetBotListByClientName(client_name, class_id)`. # Notes - Adds overload to get bots by client name and class ID.
This commit is contained in:
+3
-2
@@ -5185,7 +5185,7 @@ std::vector<Bot *> EntityList::GetBotListByCharacterID(uint32 character_id, uint
|
||||
return client_bot_list;
|
||||
}
|
||||
|
||||
std::vector<Bot *> EntityList::GetBotListByClientName(std::string client_name)
|
||||
std::vector<Bot *> EntityList::GetBotListByClientName(std::string client_name, uint8 class_id)
|
||||
{
|
||||
std::vector<Bot *> client_bot_list;
|
||||
|
||||
@@ -5196,7 +5196,8 @@ std::vector<Bot *> EntityList::GetBotListByClientName(std::string client_name)
|
||||
for (const auto& b : bot_list) {
|
||||
if (
|
||||
b->GetOwner() &&
|
||||
Strings::ToLower(b->GetOwner()->GetCleanName()) == Strings::ToLower(client_name)
|
||||
Strings::ToLower(b->GetOwner()->GetCleanName()) == Strings::ToLower(client_name) &&
|
||||
(!class_id || b->GetClass() == class_id)
|
||||
) {
|
||||
client_bot_list.push_back(b);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user