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

This commit is contained in:
Kinglykrab
2022-04-02 17:51:26 -04:00
committed by GitHub
parent ccd0713b33
commit a39a825045
5 changed files with 76 additions and 5 deletions
+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;