[Quest API] Add GetBotListByCharacterID() to Perl/Lua. (#2069)

This commit is contained in:
Kinglykrab authored and GitHub committed 2022-04-02 17:51:26 -04:00
1 parent ccd0713b33
commit a39a825045
5 files changed
+76 -5

No files matched your search

+17
View File
@@ -5062,6 +5062,23 @@ void EntityList::GetBotList(std::list<Bot *> &b_list)
}
}
std::vector<Bot *> EntityList::GetBotListByCharacterID(uint32 character_id)
{
std::vector<Bot *> client_bot_list;
if (!character_id) {
return client_bot_list;
}
for (auto bot : bot_list) {
if (bot->GetOwner() && bot->GetBotOwnerCharacterID() == character_id) {
client_bot_list.push_back(bot);
}
}
return client_bot_list;
}
std::vector<Bot *> EntityList::GetBotListByClientName(std::string client_name)
{
std::vector<Bot *> client_bot_list;