mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-18 16:38:26 +00:00
[Quest API] Add GetBotListByClientName(client_name) to Perl/Lua. (#2064)
* [Quest API] Add GetBotListByClientName(client_name) to Perl/Lua. - Add $entity_list->GetBotListByClientName(client_name) to Perl. - Add eq.get_entity_list():GetBotListByClientName(client_name) to Lua. - Allows you to get a bot list comprised solely of a specific character's bots. * Update lua_entity_list.cpp
This commit is contained in:
+19
-2
@@ -5057,10 +5057,27 @@ void EntityList::GetClientList(std::list<Client *> &c_list)
|
||||
void EntityList::GetBotList(std::list<Bot *> &b_list)
|
||||
{
|
||||
b_list.clear();
|
||||
for (auto bot_iterator : bot_list) {
|
||||
b_list.push_back(bot_iterator);
|
||||
for (auto bot : bot_list) {
|
||||
b_list.push_back(bot);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<Bot *> EntityList::GetBotListByClientName(std::string client_name)
|
||||
{
|
||||
std::vector<Bot *> client_bot_list;
|
||||
|
||||
if (client_name.empty()) {
|
||||
return client_bot_list;
|
||||
}
|
||||
|
||||
for (auto bot : bot_list) {
|
||||
if (bot->GetOwner() && str_tolower(bot->GetOwner()->GetCleanName()) == str_tolower(client_name)) {
|
||||
client_bot_list.push_back(bot);
|
||||
}
|
||||
}
|
||||
|
||||
return client_bot_list;
|
||||
}
|
||||
#endif
|
||||
|
||||
void EntityList::GetCorpseList(std::list<Corpse *> &c_list)
|
||||
|
||||
Reference in New Issue
Block a user