mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 07:18:37 +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:
@@ -375,8 +375,19 @@ Lua_Bot_List Lua_EntityList::GetBotList() {
|
||||
Lua_Safe_Call_Class(Lua_Bot_List);
|
||||
Lua_Bot_List ret;
|
||||
auto &bot_list = self->GetBotList();
|
||||
for (auto bot_iterator : bot_list) {
|
||||
ret.entries.push_back(Lua_Bot(bot_iterator));
|
||||
for (auto bot : bot_list) {
|
||||
ret.entries.push_back(Lua_Bot(bot));
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Lua_Bot_List Lua_EntityList::GetBotListByClientName(std::string client_name) {
|
||||
Lua_Safe_Call_Class(Lua_Bot_List);
|
||||
Lua_Bot_List ret;
|
||||
auto bot_list = self->GetBotListByClientName(client_name);
|
||||
for (auto bot : bot_list) {
|
||||
ret.entries.push_back(Lua_Bot(bot));
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -519,6 +530,7 @@ luabind::scope lua_register_entity_list() {
|
||||
.def("GetBotByID", (Lua_Bot(Lua_EntityList::*)(uint32))&Lua_EntityList::GetBotByID)
|
||||
.def("GetBotByName", (Lua_Bot(Lua_EntityList::*)(std::string))&Lua_EntityList::GetBotByName)
|
||||
.def("GetBotList", (Lua_Bot_List(Lua_EntityList::*)(void))&Lua_EntityList::GetBotList)
|
||||
.def("GetBotListByClientName", (Lua_Bot_List(Lua_EntityList::*)(std::string))&Lua_EntityList::GetBotListByClientName)
|
||||
#endif
|
||||
.def("GetClientByAccID", (Lua_Client(Lua_EntityList::*)(uint32))&Lua_EntityList::GetClientByAccID)
|
||||
.def("GetClientByCharID", (Lua_Client(Lua_EntityList::*)(uint32))&Lua_EntityList::GetClientByCharID)
|
||||
|
||||
Reference in New Issue
Block a user