Fix lua raid GetGroup(client) and add lua raid GetGroupNumber(index)

This number will return group number and not let us iterate a bunch of
times to verify group numbers
This commit is contained in:
Michael Cook (mackal)
2018-08-15 21:35:19 -04:00
parent 54abeba1ce
commit 585ef81fde
2 changed files with 14 additions and 1 deletions
+13 -1
View File
@@ -122,6 +122,16 @@ Lua_Client Lua_Raid::GetMember(int index) {
return self->members[index].member;
}
int Lua_Raid::GetGroupNumber(int index) {
Lua_Safe_Call_Int();
if(index >= 72 || index < 0 || self->members[index].GroupNumber == RAID_GROUPLESS) {
return -1;
}
return self->members[index].GroupNumber;
}
luabind::scope lua_register_raid() {
return luabind::class_<Lua_Raid>("Raid")
@@ -133,6 +143,7 @@ luabind::scope lua_register_raid() {
.def("GroupCount", (int(Lua_Raid::*)(uint32))&Lua_Raid::GroupCount)
.def("RaidCount", (int(Lua_Raid::*)(void))&Lua_Raid::RaidCount)
.def("GetGroup", (uint32(Lua_Raid::*)(const char*))&Lua_Raid::GetGroup)
.def("GetGroup", (uint32(Lua_Raid::*)(Lua_Client))&Lua_Raid::GetGroup)
.def("SplitExp", (void(Lua_Raid::*)(uint32,Lua_Mob))&Lua_Raid::SplitExp)
.def("GetTotalRaidDamage", (uint32(Lua_Raid::*)(Lua_Mob))&Lua_Raid::GetTotalRaidDamage)
.def("SplitMoney", (void(Lua_Raid::*)(uint32,uint32,uint32,uint32))&Lua_Raid::SplitMoney)
@@ -146,7 +157,8 @@ luabind::scope lua_register_raid() {
.def("TeleportGroup", (int(Lua_Raid::*)(Lua_Mob,uint32,uint32,float,float,float,float,uint32))&Lua_Raid::TeleportGroup)
.def("TeleportRaid", (int(Lua_Raid::*)(Lua_Mob,uint32,uint32,float,float,float,float))&Lua_Raid::TeleportRaid)
.def("GetID", (int(Lua_Raid::*)(void))&Lua_Raid::GetID)
.def("GetMember", (Lua_Client(Lua_Raid::*)(int))&Lua_Raid::GetMember);
.def("GetMember", (Lua_Client(Lua_Raid::*)(int))&Lua_Raid::GetMember)
.def("GetGroupNumber", (int(Lua_Raid::*)(int))&Lua_Raid::GetGroupNumber);
}
#endif