[Bot] Add GetBotOwnerByBotID Method (#2715)

* [Bot] Add GetBotOwnerByBotID Method

* Cleanup.

* Remove EVENT_DESPAWN exports in Lua.

Co-authored-by: Kinglykrab <kinglykrab@gmail.com>
This commit is contained in:
Aeadoin
2023-01-10 21:14:42 -05:00
committed by GitHub
parent 0d23ffe5e5
commit 8fe02b5ed1
11 changed files with 107 additions and 10 deletions
+12
View File
@@ -399,6 +399,16 @@ Lua_Bot_List Lua_EntityList::GetBotList() {
return ret;
}
Lua_Client Lua_EntityList::GetBotOwnerByBotEntityID(uint32 entity_id) {
Lua_Safe_Call_Class(Lua_Client);
return Lua_Client(self->GetBotOwnerByBotEntityID(entity_id));
}
Lua_Client Lua_EntityList::GetBotOwnerByBotID(uint32 bot_id) {
Lua_Safe_Call_Class(Lua_Client);
return Lua_Client(self->GetBotOwnerByBotID(bot_id));
}
Lua_Bot_List Lua_EntityList::GetBotListByCharacterID(uint32 character_id) {
Lua_Safe_Call_Class(Lua_Bot_List);
Lua_Bot_List ret;
@@ -649,6 +659,8 @@ 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("GetBotOwnerByBotEntityID", (Lua_Client(Lua_EntityList::*)(uint32))&Lua_EntityList::GetBotOwnerByBotEntityID)
.def("GetBotOwnerByBotID", (Lua_Client(Lua_EntityList::*)(uint32))&Lua_EntityList::GetBotOwnerByBotID)
.def("GetBotListByCharacterID", (Lua_Bot_List(Lua_EntityList::*)(uint32))&Lua_EntityList::GetBotListByCharacterID)
.def("GetBotListByCharacterID", (Lua_Bot_List(Lua_EntityList::*)(uint32,uint8))&Lua_EntityList::GetBotListByCharacterID)
.def("GetBotListByClientName", (Lua_Bot_List(Lua_EntityList::*)(std::string))&Lua_EntityList::GetBotListByClientName)